Tired of entering your password everytime you want to connect to a server? Me too, read this.
Creating your public Key
- On your local machine.
- Open Terminal.
- ssh-keygen
- Hit enter when asked for filename or password
Creating Server Aliases
- Edit ~/.ssh/config file
- Add the following:
Host ALIAS
HostName HOST.COM
User USER
- Save
Adding Key to Authorized Keys on Server
- scp ~/.ssh/id_rsa.pub ALIAS:
- ssh ALIAS
- Enter password when prompted.
- mkdir .ssh
- chmod 700 .ssh
- cd .ssh
- touch authorized_keys
- chmod 600 authorized_keys
- cat ~/id_rsa.pub >> authorized_keys
Now you should be able to do ... ssh ALIAS and instantly login to your server.