how to ssh without password

July 18th, 2007 mysurface Posted in Admin, ssh, ssh-copy-id, ssh-keygen | Hits: 102151 | 16 Comments »

Search though google, there are a tons of tutorial for accessing a remote site through ssh without a password. I found some tutorial gives too much details. Sometimes, detail’s explanation may confuse the beginners. I just want to make things done, I don’t want to know too much about the public key, private key and network authentication’s stuff. Therefore, I am here to provide the clean steps without further explanation .

Let say you want to access to a machine with IP 10.0.0.4, and make sure you have command ssh, ssh-keygen, ssh-copy-id.

First, generate the ‘key’, the key will be used to open the remote machine’s door.

ssh-keygen

You will see something like that

Enter file in which to save the key (/home/myname/.ssh/id_rsa):

Whatever it appears just press enter until it ends, press enter for passphase as well.

Okay, the ‘key’ will be generated, something looks like ~/.ssh/id_rsa.pub

Copy over the ‘key’ to remote machine, and enter your password

ssh-copy-id -i ~/.ssh/id_rsa.pub mysurface@10.0.0.4

Done. Now you can ssh 10.0.0.4 with username mysurface without password.

ssh mysurface@10.0.0.4

16 Responses to “how to ssh without password”

  1. “Whatever it appears just press enter until it ends, press enter for passphase as well.”

    It’s perharps a bit dangerous. If someone obtain your ssh key file, he can connect via ssh as he want.

    A password is needed. Having to type it every time not, and ssh-agent (or ssh frontend agent) exists for this reason. You enter your passphrase one time, and that’s all folk.

  2. I get this error trying to connect with remote server:
    Permission denied (publickey,password)

    The server also ask me for password

  3. aitor:

    I get that also for the first time I do that. While doing ssh-keygen, just enter even it asked for password. If you have security concern, maybe you should try out ssh-agent.

  4. May I know how to send mail with out user name and password

  5. I get that also for the first time I do that. While doing ssh-keygen, just enter even it asked for password. If you have security concern, maybe you should try out ssh-agent.

  6. it still asks me for password…the file authorized_keys on the server is updated but still i am asked to pass the password…..
    any sugestions,pls?

  7. It’s nice to know some ways to use passwordless SSH login once you’ve set it up: http://www.docplanet.org/linux/ssh-login-without-password/

  8. it still asks me for password…the file authorized_keys on the server is updated but still i am asked to pass the password…..
    any sugestions,pls?

  9. Some times its a pain in the ass to read what website owners wrote but this site is very user pleasant! .

  10. This is a good, common sense article. Very helpful to one who is just finding the resouces about this part. It will certainly help educate me.

  11. Great tutorial! OS X does not have ssh-copy-id installed. Instead you can use this command:

    scp ~/.ssh/id_rsa.pub user@server:~/.ssh/authorized_keys

    If it says directory does not exist (like it did on my host 1and1) then just create the directory .ssh and “touch .ssh/authorized_keys”. Then run the command. Worked like a charm.

  12. hi i followed above but still m not able to login without passwd… m using ubuntu;

    stpes i followed:

    1.ssh-keygen
    2.ssh-copy-id -i ~/.ssh/id_rsa.pub jack@172.20.22.22
    3.ssh jack@172.20.22.22

    but still it asks me passwd..

  13. I’m extremely impressed with your writing skills and also with the layout on your blog. Is this a paid theme or did you modify it yourself? Anyway keep up the nice quality writing, it’s rare to see a nice blog like this one nowadays..

  14. Thanks it works,!

  15. Thank u soo much… its working fine…

Leave a Reply