Secure Shell (SSH)

A guide to using SSH for MAC-OS users by Monir Zaman (Md. Moniruzzaman)

September 29, 2011

Download SSH client

List of Computer Science Servers: csc.cpsc.ucalgary.ca, csd.cpsc.ucalgary.ca, cse.cpsc.ucalgary.ca, csl.cpsc.ucalgary.ca

Connect to remote hosts from Unix/Linux/MAC machine using SSH:

Command: ssh username@destinationHostName

Example: if your user name Jack and the destination host is csc.cpsc.ucalgary.ca, then you should enter the following command to the terminal

localUnix$ ssh jack@csc.cpsc.ucalgary.ca

Once this command is entered properly, you will be prompted for password.

Transfer files from Unix/Linux/MAC machine to remote hosts using SSH:

Command: scp [option] sourceFile usrname@destinationHostName:destinationFile

e.g., Say you want to transfer a file called /usr/local/names.txt from the current directory of your local machine to the myFolder directory of the server csc.cpsc.ucalgary.ca. You need to have a user name (e.g. roben) and password in the server. The following command can transfer the file.

localUnix$ scp /usr/local/names.txt roben@csc.cpsc.ucalgary.ca:/usr/temp/myFolder/names.txt

The symbol ~ represents the home directory. The path ~/local/names.txt mean the same as /usr/local/names.txt

You can transfer file between two remote hosts by the following command.

scp [option] usrname@sourceHostName:originalFile usrname@destinationHostName:destinationFile

Connect to remote hosts from Windows machine using SSH:

Start the secure shell client. Enter the host name and user name in the dialog box. Next, you will be prompted for password.

Transfer files from Windows machine to remote hosts using SSH File Transfer Client:

Typically, SSH File Transfer Client is installed along with SSH client on Windows. The file transfer client has a GUI that shows your files on Windows on Left side and files on remote server on Right side. You can transfer file to/from your machine using this GUI. It looks like the following:

Use this interface to transfer files to/from your local machines.