Troubleshooting ssh connections problem
Micky found this which was key to debugging our connection problem— one way to watch what is happening with the SSH connection attempt is by opening a port just for this use on the server:
sudo /usr/sbin/sshd -d -p 2222
Then from the client:
ssh -vv -p 2222 example.com
Per http://www.unixlore.net/articles/troubleshooting-ssh-connections.html
In this case, the problem was (as suspected) a holdover from an apparently successful change of the user's username with usermod:
sudo usermod -l newusername -m -d /home/newusername oldusername
Every usual place on Debian Linux — the /home directory of course, the /etc/passwd file — had the rename perfectly. Looking at the terminal output on the server while the test connection to port 2222 (instead of 22) took place, we could spot the error:
debug1: Could not open authorized keys '/var/lib/monkeysphere/authorized_keys/newusername': No such file or directory
Our server setup uses monkeysphere. Yours probably doesn't. But for us, moving the oldusername file to the username wasn't enough, we also needed sudo monkeysphere-authentication update-users
.
But the important lesson is how to see what the problem is!
Comments
Post new comment