Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I use a notebook with Ubuntu 12.10 and try to connect a server with Ubuntu 12.04. The server has already installed openssh-server. And allow publick key and password to login. But I connect the server sometime well but after minutes it will be error. First, it will show me these messages:

   WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
   ......
   Add correct host key in /home/myname/.ssh/known_hosts to get rid of this message.

but I never reinstall system and the openssh-server. Both are never changed! The server nerver shutdown or reboot.

Second, after I remove the relative key from my known_hosts and use ssh connect the server again, it will let me type my password. then my nightmare coming... Permission denied (publickey,password)

But I typed the correct password!

PS: I used password and public key both success. But the problem will appear again after i logout then login.

share|improve this question
add comment

migrated from stackoverflow.com Nov 23 '12 at 10:18

This question came from our site for professional and enthusiast programmers.

1 Answer

Do you want to allow password auth? If so you can edit the /etc/ssh/sshd_config to include:

PasswordAuthentication yes

Also make sure these are set correctly for your key auth:

PubkeyAuthentication yes
AuthorizedKeysFile     %h/.ssh/authorized_keys

You can also have it ignore your known_hosts file... for debugging only please :)

IgnoreUserKnownHosts yes

Also ensure you have correct perms on your key files.. ssh is very particular about it:

chmod 700 ~/.ssh
chmod 600 ~/.ssh/*

Lastly, if all else fails send us output of your session attempt using 'ssh -vvvv'.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.