Managing SLED or SLES machines from Mac OS X

Linux is a “unix-like” operating system while Mac OS X is based on BSD Unix, and as such they are basically cousins :-)

There are a number of tools that ship with your Mac by default, and others that are included on the installation media that can be used to remotely administer SUSE Linux Enterprise Desktop or SUSE Linux Enterprise Server Machines from your Mac.

Note: For the purpose of this article I am using SLED/SLES 10 SP1 and Mac OS X 10.5 (Leopard)
Virtual Network Computing (VNC) is a graphical desktop sharing system which uses the RFB protocol to remotely control another computer. It transmits the keyboard and mouse events from one computer to another, relaying the graphical screen updates back in the other direction, over a network. There have been many free VNC clients for OS X in the past (http://sourceforge.net/projects/cotvnc/), but now Apple is shipping one in 10.5 which is installed by default. You may not know about it because it is not located in an obvious place. You can find it by browsing in Finder to /System/Library/CoreServices/Screen\ Sharing.app. To make it easier to find again you can either drag it onto your dock, or create and alias to it in /Applications.

Before you can use vnc, you have to configure a VNC server on your Linux machine (in Gnome :-):

  • Go to “Control Center” in your computer button.
  • Click on “Remote Desktop”
  • Make click on the checkbox next to “Allow other users to view your desktop”.
  • If this is on a headless server make sure you un-click “ask for your confirmation”. Otherwise you won’t be able to VNC in until someone clicks “allow access” on the local machine.
  • If you like, you can set a password. Note that by default VNC is not necessarilly a secure protocol. For added security investigate the use of SSH tunneling.
  • Make sure that your firewall is either off or the appropriate port is open. In most cases this is port 5900
  • OPTIONAL: There is also a yast module called “Remote Administration”. This will setup a vnc server as well, but in a different manner. Rather than viewing the current session (screen 0) you will have your own session. This may be more useful in a server environment. Additionally you will be able to access your session through a VNC client or a java-enabled web browser.

Configure your Mac to connect:

  • Make sure that your firewall is either off or the appropriate port is open. The easiest way to do this is to go into System Prefferences>Sharing and check “Screen Sharing”.
  • Open up the “Screen Sharing” application and pop in the IP address of your Linux machine.
  • Enter a password if you set one.

Secure Shell or SSH is a network protocol that allows data to be exchanged using a secure channel between two computers. SSH is typically used to log into a remote machine and execute commands, but it also supports tunneling, forwarding arbitrary TCP ports and X11 connections; it can transfer files using the associated SFTP or SCP protocols. SSH uses the client-server protocol. An SSH server, by default, listens on the standard TCP port 22.

Enable SSH on your Linux machine:

  • Make sure that the ssh daemon is running: rcsshd status If it is not running, start it by entering rcsshd restart
  • Optional: to start ssh on startup (if it doesn’t already) issue this command: insserv sshd
  • Make sure that port 22 is open in your firewall, or that the firewall is off. You may configure your firewall by entering yast2 firewall or simply browsing to it in yast

Using SSH on your Mac:

  • Turn off your firewall or make sure that port 22 is open. The easiest way to do this is to go into System Prefferences>Sharing and check “remote login”.
  • Your Mac already has SSH installed on it by default. You access it through the command line from terminal.app located in /Applications/Utilities/Terminal.app
  • Once you have opened terminal the syntax to connect is: ssh username@ipaddress where ‘username’ is the username on your Linux machine and ‘ipaddress’ is the ipaddress of your Linux machine.
  • You can also use the ’scp’ command to transfer files back and forth between your Mac and your Linux box. The syntax for this is: scp /path/to/file/to/be/coppied username@ipaddress:/path/to/place/to/be/coppied/to
  • You can use the ‘-r’ parameter scp -r to copy folders/directories

X11.app is Apple Computer’s implementation of the X Window System for Mac OS X. Apple’s implementation of X11 is based on the X.Org Server and adds support for hardware-accelerated 2D graphics, hardware OpenGL acceleration and integration with Aqua, the Mac OS X graphical user interface (GUI). The cool thing about X11.app is that it will allow you to securely access applications running on Linux machine as if they were running locally on your Mac. Previous versions of X11.app were very slow, but now with the version released in 10.5, Apple has done a great job of speeding the application up.

In older versions of Mac OS X you had to opt-in to installing this package during the OS X installation process, or install it afterwards off of the DVD. From what I can tell it is now installed by default on OS X 10.5. If it is not, you can install it by:

  • Inserting your 10.5 installation media
  • Browsing to “Optional Installs” and then running “optional installs.mpkg”.
  • After accepting the license, twirl down “applications” and select X11.

To access applications over X using X11.app:

  • Turn off firewall (as we discussed in the ssh section above)
  • Startup the X11 application which is located in: /Applications/Utilities/X11.app
  • Once it is open you will be presented with an xterm window. This should be familiar as you are also a linux user :-)
  • Once again we will use SSH, but this time with one additional parameter: ssh -X username@ipaddress (make sure that you use an uppercase ‘X’)
  • Now that you have authenticated you can launch either graphical or terminal based applications from xterm on your Mac. After executing the command the application should pop-up on your Mac’s screen.
  • You can now run applications like: yast2, gftp, firefox, control-center, application-browser, gconf-editor, gedit, gnome-system-monitor etc. from your Mac.

Notes: Applications launched through X11 are not actually running on your Mac. When you open Yast it is configuring options on your Linux machine, not your Mac. You can launch and run graphical applications in the background by adding a ‘&’ to the end of your command. For example:

gconf-editor &

You will be returned to the command line after executing this command so that you can launch another application. Another note is that I have experienced weirdness when launching nautilus in X11. If anyone has a solution to this please post a comment!