SSH Passwordless Login Using SSH Keygen in 5 Easy Steps

Download all articles in PDF format with our TecMint Content Subscription and Linux Support Services starting at $10 per month.

Support TecMint: Did you find this tutorial helpful?. Please help to keep it alive by donating. Every cent counts! - Donate Now

Ravi Saive

I am Ravi Saive, creator of TecMint. A Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux. Follow Me: Twitter, Facebook and Google+

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

Receive Your Free Complimentary eBook NOW! -

Download Free Linux eBooks

Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Introduction to Linux - A Hands on Guide

You may also like...

155 Responses

  1. J.R.Einhorn says:

    Hi – Thanks for this information. I followed your instructions with the ssh client on Solaris 10 and the target on RHEL-7. If the target has SElinux disabled, it works. But if the target has SElinux enabled, it does not work.
    I was able to fix it by following the instructions here: http://stackoverflow.com/questions/9741574/redhat-6-oracle-linux-6-is-not-allowing-key-authentication-via-ssh

    chown -R : ~/.ssh
    chmod 700 ~/.ssh
    chmod 600 ~/.ssh/*
    restorecon -R -v ~/.ssh

  2. Ravikumar Wagh says:

    Hello,

    Thanks for post.
    I have one query :
    I want to reset password of multiple servers with an script, Can we pass password as parameter while ssh to set new password.
    in parameter.

    Thanks !

  3. Ravi says:

    Cool post. Thanks

  4. Pradeep Kumar B says:

    Hi All,
    I have a question on automation.
    I have EMC datadomain boxes runs on proprietary RHEL, I have a command called “df” which will provide status of the file system.
    I would like to add this command into a script along with RSA SSH passwordless authentication with a time out of 30 sec. Can you please help / share some idea

    • Ravi Saive says:

      @Pradeep,

      First create a SSH passwordless authentication on the server that you want to connect to remote host and then create a script with df command and run with cron every 30 seconds..

  5. KOMO sava says:

    Hi Ravi Saive,
    i would like use ( ssh user@10.79.124.34 ssh -version ) but i no need type my password again.
    please help me write script.
    Thanks,

  6. Rajveer says:

    Hi,
    Thanks for your great article. it is really awesome.
    Now I have a question here.. please suggest me…

    suppose I have a server (192.168.0.1) with SSH enable and one of my client (19.168.0.2) is accessing it from any user account. After performing some task on server, the client close the ssh session. Now on server end, I want to check what the client did, which commands did he run (total activity by client)
    could you please tell me ho can I do that on server end?

    Thanks in advance!

  7. Vipin Bansal says:

    After following your steps, It’s still asking for password. On one machine, id_rsa.pub was already present and able to do passwordless ssh on most of other client machines but not able to do on one. The one on which, these steps didn;t worked has “.ssh” folder with 700 permission and inside that “authorized_keys” file only with 640 permission. Nothing else is present, I just used following command as id_rsa.pub file was already present:
    cat .ssh/id_rsa.pub | ssh ‘cat >> .ssh/authorized_keys’

    Still asking for password. Can you please help. I have restarted sshd also from my client machine.

  8. sahil says:

    issue resolved….Thank you

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

Join Over 95000+ Linux Users
  1. 77,543
  2. 4,213
  3. 35,218

Enter your email to get latest Linux Howto's