Supercomputing Institute Technical User Support

SSH and SCP Clients for UNIX

Getting Started with OpenSSH

SSH is used to login to a remote machine from your local machine and to execute a command on a remote machine. SCP is use to copy files between a local and a remote machine. SCP should be used instead of ftp.

Using SSH to connect to a remote machine

Use ssh to login your local machine to another machine, or to run a command on a remote machine. For example, to connect to the machine i7.msi.umn.edu, use the following command:

ssh -X i7.msi.umn.edu

or, if you want to use a different login name on the remote machine than on your local machine

ssh -Xl remote-user-name i7.msi.umn.edu

If all goes well, you will be asked to enter your password, and the connection will be established. When you use ssh to connect, the DISPLAY environment variable is automatically set to forward X11 programs to the local machine.

There are several warning messages that you may receive.

Using SSH to run a command on a remote machine

To run a command on a remote machine, just add a command to the end of the SSHcommand that you use to connect to a remote machine. This command replaces the insecure rsh command. For example, to get a listing of files (ls) on i7.msi.umn.edu,

ssh -X i7.msi.umn.edu ls

or, if you want to use a different login name on the remote machine:

ssh -Xl remote-user-name i7.msi.umn.edu ls

Getting Started with SCP

Use SCP to copy files from one machine to another. SCP replaces rcp, should be used instead of ftp. It also has more flexibility than ftp and can be use to copy directories instead of just files. The general form of SCP is:

scp [[user@]host1:]filename1 [[user@]host2:]filename2

Where filename1 and filename2 can be file or directory names. If your user name is the same on both the local and remote machines, then you do not have to provide the user@. If you are copying from your local machine, you do not have to provide the name of host1. For example, to copy a file called temp.ps from a local machine to i7.msi.umn.edu, use the following command:

scp temp.ps i7.msi.umn.edu:temp.ps

The file temp.ps will be copied to your home directory on i7. If you have a different user name on i7, then specify it as shown below.

scp temp.ps remote-user-name@i7.msi.umn.edu:temp.ps

Using SSH and SCP without entering passwords

To permit a connection (ssh or scp) from a local machine to a remote machine without always typing a password, on the remote machine, create the file ".shosts" in your home that contains the name of the local machine. The permissions on "e;.shosts"e; should be rw for the user and --- for everyone else (The command chmod 600 .shosts will set the permissions correctly). If you have the file ".rhosts", please delete it.

SSH and SCP will use the ssh_know_hosts file. If the local machine is correctly entered in the user's .ssh/known_hosts file, then the connection will be permitted with out a password.

To make this work, you may need to log back in from the remote machine to your local machine. For example, if your local machine is i7.msi.umn.edu and you want to connect to origin.msi.umn.edu, use the following procedure to set up connecting from i7 to origin without a password:

If you have an account on any of the Institute's machines and have difficulties, please contact help@msi.umn.edu or call (612) 626-0802.