- 2008-07-21 (Mon) 23:17
- Tech
I do this freaking a lot of times, and I sometimes forget about the process, so just to remind myself. It’s not only real easy, but also very secure. I highly recommend it. Technically it is called “SSH Key Exchange.” There might be a better person to talk about how it works, so I only explain how to set up.
Precondition
- Server has configured to accept PubkeyAuthentication
Most likely, what a server admin need to do is comment-in 3 lines at/etc/ssh/sshd_config, and reboot ssh. - You have generated a RSA key pair
This is also very easy. Just typessh-keygen -t rsa - Use Mac OS X or Unix based system.
I know windows people can do it with Putty. When I need to do it, I will write this again.
Procedure
- login to where you want to connect to.
- make a directory on $HOME on the server you want to connect to
mkdir .ssh chmod 700 .ssh - copy public key from the client where you want to connect from. You can just open it with any text editor and get rid of line break.
open $HOME/.ssh/id_rsa.pub - make a file on the server you want to connect to.
cd $HOME/.ssh vi authorized_keys ... chmod 755 authorized_keys - try to connect
ssh -i $HOME/.ssh/id_rsa -l USERNAME HOST_TO_CONNECT
That’s all! I often times, forgot to change permission… It matters!
- Newer: Set up Pear and Symfony on Dreamhost in 5 minutes.
- Older: 『察知力』を読んで
Comments:1
- Takashi Mizohata 09-01-14 (Wed) 18:07
-
I tried this again. I just copied from Terminal window, and I left and pasted it into “CONNECT TO” ’s authorized_keys. And it didn’t work. I saw error on /var/log/messages, sayng… “sshd[XXXX] error: key_read: uudecode XXXXX failed” So I got rid of from each line and it worked! No new line on public keys!
Trackbacks:0
- Trackback URL for this entry
- http://blog.nydd.org/2008/07/set-up-password-less-ssh-in-5-minutes/trackback/
- Listed below are links to weblogs that reference
- Set up password-less ssh in 5 minutes from Vantage Point of Queens