Login with SSH without password (Mac, Linux)

1. Go to computer where you want to connect from. Check the folder $HOME/.ssh/, if there is a file id_rsa.pub then skip this step. Otherwise generate generate new rsa keys using the following command:

ssh-keygen -t rsa

2. Go to computer where you want to connect with ssh to. Check the folder $HOME/.ssh/, if it exists then skip this step otherwise create new one with the command:

mkdir -p .ssh

3. Go back to computer where you want to connect from and use the command below to copy public key, it will ask your password for the last one time:

cat ~/.ssh/id_rsa.pub | ssh user_on_remote_computer@remote_computer_host  'cat >> ~/.ssh/authorized_keys'

4. We are ready! Connect without entering password:

ssh user_on_remote_computer@remote_computer_host

Enjoy!

,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: