Standard Training: SSH - Secure Shell Login¶
cryptographic network protocol for, e.g., remote command-line login
Basic Features¶
Remote Login¶
ssh: remote login
-
login to remote
hostusing current username (i.e.,$USERenvirnment variable in Unix-like systems): -
login to remote
hostusing specific username (e.g.,foo):
ssh-keygen+ssh-copy-id: password-less login (public-private key pairs)
Be careful not to overwrite your existing ssh keys
- First check for existing keys
- generate a ssh key pair using RSA cryptosystem
Security Note
~/.ssh/id_rsa: keep it secret (do not share)~/.ssh/id_rsa.pubshare it for remote authentification (see below)
- install public key to remote server
host(please replacehostwith where you are copying your public key):
Remote File Copy¶
scp: remote copy over ssh
scpworks similar tocpand copies filefoofromuser1@host1touser2@host2asbar:- When
hostanduserare not specified they are treated as yourlocalhostand$USER; if a path is not given, the path is assumed to be in the$HOMEfolder. As an example, to copy a fileoutputfrom$HOMEon cruntch4 back to current directory of the local machine can be done via: - To copy, multiple files in one-shot, one can first make a tarball via
tarand doscp: - Other remote copying options are:
sftporsshfs. One may also use a GUI to help; see this thread for some options
More Advanced Features (Optional)¶
~/.ssh/config: custom ssh configurations
To login to hosts with longer name or with a different user id, one can add custom configurations in ~/.ssh/config
- simplify ssh login to from
ssh EUID@cruntch4.chem.unt.edutossh cruntch4, one can add the following lines in~/.ssh/config(replaceEUIDwith your EUID):
ssh (VPN) tunnel
-
build the tunnel with the host and connect to a local port (
5000in this case) -
set up browser proxy to redirect traffic, e.g., when using Firefox change Connection settings to:

FAQ about SSH¶
Can I use the same SSH for multiple servers?
Yes, it is generally safe and convenient to do so. Related discussions can be found in this thread and this thread