Operating System - HP-UX
1851095 Members
2100 Online
104056 Solutions
New Discussion

Re: ssh asked for password

 
SOLVED
Go to solution
MikeL_4
Super Advisor

ssh asked for password

I've setup a new server, Igniting it from another of our production servers.
On the new server I ran
1) ssh-keygen -t dsa on the new server
2) copied the id_dsa.pub file into the authorized_keys file on both the new server and our "master" HP server

from the master HP server when I do an ssh to the new server it still prompts me for the new servers password.

What am I missing in the setup ???
6 REPLIES 6
Denver Osborn
Honored Contributor
Solution

Re: ssh asked for password

If you want to ssh from the "master" HP server to the new server, you'll need to generate a keypair on the master server and put the public key into the new servers authorized_keys file.

From what you described above, the keypair was created on the new server and the public key was copied to the authorized keys on the new and master server... that would allow you to login from the new server to the new server or from the new to master server but not the other way around.

So if you need to use public key auth from the master to the new server you'll need to put a keypair on the master and append it's public key to the new server.

Also double check the syslog.log for sshd errors and use "ssh -vvv" to debug.

Hope this helps,
-denver
MikeL_4
Super Advisor

Re: ssh asked for password

If I generate a new key on the "master" server and place it in the authorozed_keys file on the new server to allow it to talk to each other will I also have to copy that new key from the master and replace it on all the other servers that are already working ??
Steven E. Protter
Exalted Contributor

Re: ssh asked for password

Shalom Mike,

authorized keys depends on a few things.

Ownership of the home directory. Someone else owns it, password prompt is automatic.

permission of the files in the .ssh direcotry. To permissive, automatic prompt for a password.
ownership and permissions of the .ssh directory.

If the new machine is giving you trouble.

1) rm -rf .ssh/
2) ssh-keygen -t dsa # solving ownerhip and permission issues.
3) Copy in the authorized keys file.
If you want things to work 2 way.

cat id_dsa.pub >> authorized_keys
distribute it.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Denver Osborn
Honored Contributor

Re: ssh asked for password

Mike,

If you've got a keypair on your "master" server that is used to connect to all of your other hosts, then no need to ssh-keygen. Just take the id_dsa.pub file on the master and append it to the new server authorized_keys file.

-denver
Denver Osborn
Honored Contributor

Re: ssh asked for password

one other thing... if you've already taken the master pub file and copied to authorized_keys on the new server, how was it copied?

Did you cut/paste the .pub key to the authorized keys? If that's how it was done you should try to recreate teh authorized_keys file on the new server. Instead of cut/paste, try to scp the .pub file over then cat id_dsa.pub >> authorized_keys.

-denver
MikeL_4
Super Advisor

Re: ssh asked for password

Thanks alot, when you don't set these up that often it get's confussing what needs to be where to work..