Generating your SSH Key on Linux

  • Home
  • Docs
  • Generating your SSH Key on Linux
 

Generating your SSH Key on Linux

Linux has OpenSSH built right in! Here's how to set it up:

First, generate a new ssh key, or use Userify's private key generator:

mkdir ~/.ssh/
ssh-keygen -C "[email protected]"

When the command asks you where to save your key, just hit enter.

When prompted, a long, strong passphrase is recommended (use a phrase that only you know; it's not necessary to mix in extra punctuation if the passphrase is at least 5 or 6 randomly-chosen words.) You'll only have to type it in when you log into your desktop, not every time you want to log into a server. You can leave the other prompts blank.

You'll only have to type your passphrase in when you log into your Linux desktop session, not every time you want to log into a server. Since you're using Userify, if you forget your passphrase in the future, it's easy to rm .ssh/id_rsa* and then re-deploy a fresh key.

This will generate your SSH private key in the file ~/.ssh/id_rsa and your public key in the file ~/.ssh/id_rsa.pub. (Note the *.pub*). (~ is shorthand for your home directory, i.e., /home/username)

Upload your public key to Userify by copying and pasting the contents of ~/.ssh/id_rsa.pub in your home directory to Userify. Just cat the file and copy it from your terminal and paste it into Userify:

cat ~/.ssh/id_rsa.pub

If you have set a passphrase for your key (suggested for greater security), most Linux distributions already have built-in key managers that will work automatically.

From now on, you can connect to any Userify-enabled server without typing a password, just by typing in:

ssh [email protected]

If your Userify username is different from your Linux username, you can either ssh [email protected] each time or just add the following to .ssh/config, and then just ssh IP and drop your username from the command.

In your home directory's .ssh/ directory, create a file named config:

Host *
User YourUserifyUsername

Get More Information

Please fill out the form below to receive more information about Userify Express and Enterprise.