5-Minute Guide to SSH
5-Minute Setup Guide for SSH
SSH stands for Secure Shell — “a cryptographic network protocol for operating network services securely over an unsecured network.”1
SSH provides a secure channel over an unsecured network in a client-server architecture, connecting an SSH client application with an SSH server.2
SSH secures user name and passwords that pass through the unsecure, public Internet. It also automates the authentication process so that user name and password credentials are not even needed when making connections.
If you are not a software developer, SSH is probably not very useful to you.
If you are a software developer, SSH access to your resources is invaluable. Here is how to set your computer up to use SSH to access resources.
Setup SSH with GitHub
Using SSH to access your GitHub resources, especially from the command line, is invaluable to software developers because it secures and simplifies access. It is also a perfect way to illustrate the process of setting up SSH on your computer for use with other network services.
1. Create an SSH key.
See if your SSH key exists:
ls -al ~/.ssh
Create a new SSH key (if you don’t have one, or want to use a different key for a specific mission):
ssh-keygen -t rsa -b 4096 -C "firstname.lastname@example.org"
2. Launch the SSH Agent.
Make sure the ssh-agent is running:
eval "$(ssh-agent -s)"
See if your SSH key is registered with the agent:
Add your SSH key if it is not:
Remove keys that aren't needed or used:
ssh-add -d ~/.ssh/id_notused_rsa
3. Test a GitHub connection.
Test the GitHub connection:
ssh -T email@example.com
If it fails, ask for more details:
ssh -vT firstname.lastname@example.org
How it Works
Using Git as an example, the SSH Agent will provide Git with your GitHub credentials silently and in the background and let you perform Git operations, like cloning repositories, pushing code to your GitHub account and other similar tasks. No more user name and password prompts!
Other applications work in a similar way: They use SSH keys to secure your connections and to verify your identity with the remote service. This can be used to secure logins and file transfers with FTP programs and to lock down your connections to remotely accessed command line servers.
If these programs do not automatically seek the proper SSH keys from the SSH Agent, you can usually configure your application to use any particular SSH key file. Sometimes, you have to set up the service on the remote end to accept connections with that key file; they usually have a way for you to choose the key file of choice and to upload it. Once you have an SSH key set up at each ends, the connections will work.
1Network Working Group of the IETF, January 2006, RFC 4251, The Secure Shell (SSH) Protocol Architecture