My SSH Notes
Created On: August 31st, 2004
Last Updated On: March 18th, 2006
SSH is a secure replacement for telnet and rsh.
This document covers how to use SSH to connect to remote computers. This includes the new Subversion connection method and how to setup the public key authentication for password-less connections.
To connect to remote computer using username:
To connect to remote computer with X11 forwarding:
Use SCP to copy files
You can also use scp, a utility included with OpenSSH, to copy files directly
to a remote computer, like rcp.
Copy local file to remote computer:
Copy remote file to local computer:
If your local username is different than your remote username:
Copy directories at a time:
Creating Keys
The following will generate the public and private keys and prompt you to enter a pass phrase for the keysTwo keys are generated a public and private key, the public key has a .pub extension. This is what needs to be copied out to the server you wish to connect to. Use scp (see above) and copy the file to your home directory on the remote server.
On the remote server, append the id_rsa.pub file to your authorized_keys file:You know should be able to login to the remote box and it will prompt you for your certificate passphrase instead of your password.
Using ssh-agent for Automatic Passwords
Start ssh-agent:Source Profile:
Add Key to Agent (add pass phrase):
You can now login to remote server and you will not be prompted for your password.
You can remove a key from the ssh-agent using the following:You can also add a timeout for the key when adding:
One gotcha that I came across which was causing problems with the automatic login was the permissions on my ~/.ssh directory. It must be set to only be read by myself, in unix terms thats chmod 700
- OpenSSH Public Key Authentication [washington.edu]
- Openssh.org