{ 11 comments… read them below or add one }

1 Dillip October 17, 2007

Sir

After creation of key in pc-1 (id_rsa.pub) copy to pc-2 as authorized_keys but I am not able to ssh username@pc-2, against it is now asking password.

Kindly help

Dillip Dhala
dkdhal1@gmail.com

Reply

2 ns November 5, 2007

@Dillip

It might be that you are using SSLv2 in which case you have to copy/append the key to authorized_keys2

Reply

3 Malyadri January 27, 2008

Good tutorial…..

Reply

4 matt February 29, 2008

I do something like this:

cat .ssh/id_rsa.pub | ssh user@server “cat >> .ssh/authorized_keys”

Reply

5 Mikko May 7, 2008

e) Should be like

workstation#2 $ scp ~/.ssh/authorized_keys user@remote.server.com:.ssh/

instead of

workstation#2 $ scp ~/.ssh/id_rsa.pub user@remote.server.com:.ssh/authorized_keys
(this ruins the whole idea)

:)

Reply

6 vivek May 7, 2008

Mikko,

thanks for the heads up!

Reply

7 yh March 16, 2009

Can i know why need to append own public key to own authorized_keys?
i thought own public key is used for others?
web1 id_rsa.pub append to web2 authorized_keys (correct)
web2 id_rsa.pub append to web1 authorized_keys (correct)
web2 id_rsa.pub append to web2 authorized_keys (doubt)

Reply

8 pixeldoc April 2, 2009

if you have trouble login to your server, check if /etc/ssh/sshd_config contains Protocol 2
PubkeyAuthentication yes
.

Reply

9 Ron July 24, 2009

Thanks. We have added this to our intranet wiki, just for future ;)

Reply

10 Matt September 8, 2009

Check out the ssh-copy-id command. It will take care of appending your public key onto the remote system.

Reply

11 jay September 24, 2011

Hi folks,

Currently,for instance, many servers can do passwordless ssh to SERVER A
Now,we are migrating all the stuff from Server A to Server B.
all those servers which were connecting to Server A,now need to connect to Server B.
Can i copy over the authorized_keys file from A to B ,so all those servers can connect to server B passwordlessly.
The idea is to avoid all those servers keys addition to server B /etc/ssh/auth_keys/ file.

Does it matter if platform(solaris to linux,vice versa)is different?

2nd case:
Server A connects to other servers using ssh which is passwordless. ServerA will be replaced by server B.
do i need to send Servers’ B pub key to all those other servers have them add serverB pub key in their authorized key file?
Or to avoid this, can i just copy over the pub key pair from server A to Server B,so other servers wont have to make any change on their side.

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">




Previous post:

Next post: