Results 1 to 10 of 13
Hi All,
I can connect to the same server (from the same server) via SSH I do not have to supply a password. The ssh keys were generated a couple ...
- 04-17-2009 #1Just Joined!
- Join Date
- Apr 2009
- Location
- England
- Posts
- 3
Unusual SSH problem.
Hi All,
I can connect to the same server (from the same server) via SSH I do not have to supply a password. The ssh keys were generated a couple of years ago.
However, when I generate a new set of keys, with identical permissions, this time I am asked for a password everytime I make a connection.
No changes have been made to the ssh config files in /etc/ssh.
If I then replace the new keys with the original keys, everything is fine again?
I have stopped restarted sshd but no luck.
Have I overlooked something simple? Any help appreciated
Please attachment below (not for the faint hearted!)
- 04-17-2009 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Go to ~/.ssh and edit the known_hosts file, removing the entry for the server that is giving you this problem. It should add the new key back the next time you log in. Though it will require the password the first time, it should not do so after that.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 04-17-2009 #3Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
When you generated the new keys and were asked for a password did you supply one? To avoid being prompted for a password you should leave it blank at that stage.
- 04-17-2009 #4Just Joined!
- Join Date
- Apr 2009
- Location
- England
- Posts
- 3
Many thanks for the reply gents.
Removing entries from known_hosts makes no difference, the thing always asks for a password.
No password was entered when the keys were generated.
Cheers
- 04-18-2009 #5Linux Enthusiast
- Join Date
- Jul 2005
- Location
- Maryland
- Posts
- 521
Did new key replace old id_rsa (on the box where the keys were generated)?
Did new key replace the old one in authorized_keys on remote box?
Are permissions on authorized_keys still the same (644 or 600)?
Are permissions on .ssh directories still the same (700) ?
- 04-18-2009 #6Just Joined!
- Join Date
- Apr 2009
- Location
- England
- Posts
- 3
Hi Pavlo_7,
Yes I replaced the id_rsa and copied id_rsa.pub to authorized_keys.
The permissions are identical to what they were when connection was possible.
This is what is confusing me!
- 04-18-2009 #7Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Well, at least you can get logged in. This situation of asking you for a password might not be a bad thing, as someone who manages to get into your system under your user account will not be able to access the remote system without knowing that password as well, though if you are like me they are probably more or less the same...
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 04-19-2009 #8Linux Enthusiast
- Join Date
- Jul 2005
- Location
- Maryland
- Posts
- 521
Yeah it's a tough one, especially that it worked this way before.
OpenSSH_3.6.1p2 is older version.
So I'm guessing, maybe you need to restart sshd.
Also, check ssh_config and see maybe it "now" expects something different, like identity or authorized_keys2 instead of authorized_keys etc.
Finally, try regenerating the keys.
- 04-29-2009 #9Linux Enthusiast
- Join Date
- Jul 2005
- Location
- Maryland
- Posts
- 521
As someone mentioned in another thread today, check if permissions on known_hosts are 644 .
- 04-29-2009 #10Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
I seem to recall I had a similar problem a few years ago. The solution was to nuke all the keys and let the system regen them. Not an optimal solution, but as I recall (dimly), it worked.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote