SSH Tips and Tricks - Create a config for easier login

Useful tricks for getting the most out of your SSH session.

Consider generating a new SSH key pair called ncp with

$ ssh-keygen -b 4096

Create a config so you can effortlessly SSH into your machine.

Add this to your ~/.ssh/config file:

Host ncp
  User REPLACEMEWITHYOURUSERNAME
  Hostname IP.ADD.RES.S
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/ncp

If your SSH pub key (~/.ssh/ncp.pub) has been added to IPADDRESS:~/.ssh/authorized_keys, you should now be able to shell in by typing

$ ssh ncp

…and thanks to the ~/.ssh/config entry, the name of the server you’re trying to SSH into – namely ncp in this case – should autocomplete!

About the Author

This article was worked on by @just. Thank you so much for all you do! You may write your own articles by joining our wiki and documentation team on the forum.

2 Likes