how to ssh without password
July 18th, 2007 mysurface Posted in Admin, ssh, ssh-copy-id, ssh-keygen | Hits: 126574 | 22 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
July 19th, 2007 at 12:51 am
“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.
October 2nd, 2007 at 5:55 pm
I get this error trying to connect with remote server:
Permission denied (publickey,password)
The server also ask me for password
October 2nd, 2007 at 10:04 pm
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.
October 18th, 2007 at 3:05 am
[…] https://linux.byexamples.com/archives/297/how-to-ssh-without-password/ […]
November 6th, 2007 at 12:24 am
May I know how to send mail with out user name and password
November 6th, 2007 at 12:27 am
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.
June 11th, 2008 at 6:46 pm
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?
July 30th, 2010 at 5:10 pm
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/
December 16th, 2010 at 10:06 pm
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?
May 18th, 2011 at 7:54 pm
Some times its a pain in the ass to read what website owners wrote but this site is very user pleasant! .
May 18th, 2011 at 9:27 pm
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.
June 16th, 2011 at 8:44 am
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.
June 20th, 2011 at 9:15 pm
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..
August 29th, 2011 at 7:48 am
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..
September 15th, 2011 at 2:16 am
Thanks it works,!
September 15th, 2011 at 12:57 pm
Thank u soo much… its working fine…
February 12th, 2016 at 4:44 pm
Clean My Ass Passwords 2009 – http://cleanmyass.com/ref/1957000/
May 12th, 2016 at 1:54 pm
thank so considerablya lot for your website it assists a lot
May 12th, 2016 at 1:54 pm
You’re a very valuable website; couldn’t make it without ya!
May 12th, 2016 at 1:54 pm
You’ve one of the best webpages
July 23rd, 2016 at 11:48 pm
Good day I am so glad I found your web site, I really found you by mistake,
while I was browsing on Google for something else, Nonetheless I am here now and would just like to say
thanks a lot for a fantastic post and a all round interesting blog (I also
love the theme/design), I don’t have time to look over it all at the
minute but I have book-marked it and also included your RSS feeds,
so when I have time I will be back to read more, Please do keep up the superb
job.
my weblog HerminiaOTee
October 27th, 2016 at 5:13 pm
Good Website, Maintain the very good job. Thanks a ton!.