ssh and scp are commands that allow one to login to other machines and transfer files between machines. Ssh is a replacement for the traditional 'telnet' and 'rlogin' commands, while scp is a replacement for 'ftp' and 'rcp'. They have additional functionality, are much more secure, and once properly set up are more convenient to use.
Configuring ssh: Things that need to be done only once.
Using ssh: Things to do each time you log in. If you do not follow these steps you can still use the ssh and scp commands, but you will be prompted for a password every time you use them.
Once you configure ssh on one of the department machines you can follow the 'Using ssh' steps and then conveniently access any department machine as illustrated in the examples below. However, a non-department machine needs to be configured separately to allow the same simple access. One way to do this, for example on a nondeptmachine, is with the following command:
scp -r ~/.ssh yourlogin@nondeptmachine
where 'yourlogin' is your user name on nondeptmachine. You will be asked for your password, but afterwards you can connect to a nondeptmachine just as easily as the department machines. This same procedure can be used to enable convenient access to any non-department machine that supports the ssh family of commands.Examples: Suppose you are currently working from a local terminal window on a machine such as 'sealy'
Ssh connections have a further advantage in that they automatically encrypt and forward X information. This means that when you use ssh to connect to a machine you can securely run graphical commands like 'xv' without any additional configuration.
- Log into the nondeptmachine (as yourself)
- ssh yourlogin@nondeptmachine
- ssh nondeptmachine ls
- Run the command 'ls' on nondeptmachine
- scp localfile nondeptmachine
- Copy the file 'localfile' to your home directory on nondeptmachine
- scp localfile nondeptmachine:mydir/remotefile
- Copy 'localfile' into your directory 'mydir' on nondeptmachine and rename it 'remotefile'
- scp nondeptmachine:remotefile localfile
- Copy the file 'remotefile' from your home directory on nondeptmachine to a file named 'localfile'