[back to top]

Using UNIX from a Macintosh OS X Computer

You may not realize it, but your Mac already runs a variant of UNIX. You can easily access a terminal window to use your computer's built-in UNIX functionality with the "Terminal" program (Applications/Utilities/Terminal.app). You may want to make a shortcut to this program in your Dock, since you'll be using it a lot from now on. Similarly, you can use your Mac directly to log into a UNIX server, and even to transfer files to/from a UNIX server.

Logging into an UNIX server

The standard protocol for logging into a modern UNIX server is through using a Secure SHell (SSH) client. OS X has built-in SSH functionality, through the 'ssh' command on the Terminal.

To use ssh from the Terminal:

For additional information on using ssh, type

man ssh
(short for manual) in the Terminal window.

Enabling X11-Forwarding (Popping up windows form the UNIX server)

Your Mac comes with another program that enables you to display graphics from programs running on a remote UNIX/Linux server, called "X11" (Applications/Utilities/X11.app). If this program is not currently installed on your Mac, it is available on the OS X installation DVD that came with your computer -- install this program.

To enable forwarding, just run X11.app before starting Terminal.app. You may close the xterm window that pops up and use Terminal.app, or you may use this instead. Once this is running, when you log into remote UNIX servers (using the -X option to ssh above), you should be able to display remote graphics.

Transferring files to and from a UNIX server (terminal)

You may copy files to and from a UNIX/Linux server in the Terminal window as well, using the 'scp' command. The syntax is either

scp file_to_copy_from username@hostname:file_to_copy_to
or
scp username@hostname:file_to_copy_from file_to_copy_to
depending on whether you want to copy the file to or from the UNIX server. For example, suppose I have a file named 'file1' in my home directory on titan, and I want to copy it to my Mac:
scp danreynolds@titan.smu.edu:file1 .
or
scp danreynolds@titan.smu.edu:file1 file1
would give the desired result. Suppose now that I have the file 'file2' on my Mac that I want to copy to titan:
scp file2 danreynolds@titan.smu.edu:
or
scp file2 danreynolds@titan.smu.edu:file2
would do the trick.

Transferring files to and from a UNIX server (graphical)

You can instead use a graphical program, Fetch, to perform file transfers. This is not installed by default on most Macs, and is not a free program (though SMU users can download it from the IT web site).

To use Fetch, fill in the UNIX hostname, your username on that host, and your password on that host, then click 'Connect'. You will then see a display of your remote directory on the UNIX server. Transfer files by dragging them to and from the Finder.

D.R. Reynolds, 20 January 2009