Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Panel
borderColorblack
bgColor#ffe8cc#f5f5f5
borderWidth2
borderStylesolid

Open a command/terminal window and enter:

ssh-keygen -t rsa

If there is a need for a 4096 bit key, use the command

ssh-keygen -t rsa -b 4096

...

Panel
borderColorblack
bgColor#ffe8cc#f5f5f5
borderWidth2

Example Output:

Generating public/private rsa key pair.
Enter file in which to save the key (/Users/username/.ssh/id_rsa):

To accept the default filename of id_rsa, press Enter or Return.

Password:

Enter a password at the prompt and press Enter or Return. If you press Enter or Return without entering a password, the generated private key will not be password-protection.

Your private and corresponding public keys will be created and stored at:

~/.ssh/id_rsa
~/.ssh/id_rsa.pub

...

Panel
borderColorblack
bgColor#ffe8cc#f5f5f5
borderWidth2
borderStylesolid

First, you'll need to make sure the remote server contains the file:

~/.ssh/authorized_keys

If the file does not exist, use these commands to create the remote SSH directory and authorized_keys file:

mkdir -p ~/.ssh
touch ~/.ssh/authorized_keys


Now,

copy

your

id_rsa.pub

file

on

your

local

device

over

to

the

remote

device

scp ~/.ssh/id_rsa.pub username@remoteserver.domain.com:

...

Panel
borderColorblack
bgColor#ffe8cc#f5f5f5
borderWidth2
borderStylesolid

On the remote system, add the contents of the copied id_rsa.pub key to the authorized_keys file:

cat ~/id_rsa.pub >> ~/.ssh/authorized_keys

To check the contents of the authorized_keys file:

more ~/.ssh/authorized_keys

...

Panel
borderColorblack
bgColor#ffe8cc#f5f5f5
borderWidth2
borderStylesolid

You should now be able to use your key to SSH to the remote system from the computer that generated and hosting the RSA key (i.e., your laptop). You should not be prompted for a password, unless you assigned a password to the private key when it was generated.


ssh username@remoteserver.domain.com

For example:

ssh username@yoshi.ece.utexas.edu

...