ssh password-less

Here are steps, how to do it in Linux type environment on LOCAL host:

  1. USER_REMOTE=username@remote-host
  2. ssh-keygen -t rsa #no password
  3. ssh $USER_REMOTE mkdir -p .ssh
  4. cat .ssh/ | ssh $USER_REMOTE ‘cat >> .ssh/authorized_keys’
  5. ssh $USER_REMOTE ‘chmod 700 .ssh; chmod 640 .ssh/authorized_keys’
  6. ssh $USER_REMOTE

Step 2 is necessary only if you don’t have file yet
Steps 3,4,5 need remote password
Steps 3 and 5 are not necessary, if the file .ssh/authorized_keys with appropriate access rights is already on remote host
Step 4 actually transfers the public key
Step 6 does not need password, you are there already, congratulations!

This entry was posted in workday. Bookmark the permalink.

Leave a Reply