CSCS Home Page UM Home Page



research > lab > docs > security > linux



Secure Access and file transfer from Linux/Unix.

To use SSH to make a secure connection to another host:

You can use ssh as an alternative to telnet to establish a "shell window" connection to any host of your choice. The general command is:

   ssh hostname.domainname

So for example, you can connect to CSCS's miele computer:

   ssh miele.physics.lsa.umich.edu

Note it will try to log you in using the same login as you are using on your local machine. To log in as some other user, e.g., to login as auser on the remote machine miele:

   ssh -l auser miele.physics.lsa.umich.edu

In any case, it will prompt for the password of the login on the remote machine.

Note that the first time you do this, you may get a message about establishing a encryption key: just respond "yes" (not "y"; it means"yes").
You can then enter shell commands just as you would at the console.

To end the connection, enter

   exit

To use scp to copy files securely from one host to another:

If you are copying a file (e.g., one named "fileToCopy" in this example) from your local computer to some other host, and using the same login on both machines, use the scp as follows:

   scp  fileToCopy   miele.physics.lsa.umich.edu:

Again it will prompt for your password, then copy to the home directory of your login on the remote machine.

If you want to copy to some arbitary directory on the remote machine:

   scp  fileToCopy  miele.physics.lsa.umich.edu:/users/auser/SomeDirectory

You can copy files the other direction, i.e., from the remote to your local host:

   scp miele.physics.lsa.umich.edu:/users/auser/fileToCopy .

You can also copy sets of files that match a patter, e.g.,

   scp *.gz  miele.physics.lsa.umich.edu:

will copy all files in the working directory that end in .gz to the remote machine miele (in the users home directory).

You can also copy files when the the login's on the two machines are not the same. For example, if your local login is josh and your remote login is jtblue, to copy from the local to remote:

   scp fileToCopy  jtblue@miele.physics.lsa.umich.edu:

For additional information.

There are many other features available. You can

   man scp
   man ssh
   man sftp

or go to this web page: http://www.openssh.com/manual.html


Updated September 1, 2005