Answer the question
In order to leave comments, you need to log in
ssh authentication on server not working without login
Good day!
I have a Linux machine with Ubuntu, which I go to via ssh. By the machine there are 2 users: 1st with the administrator's rights (master) and the second with limited (slave). Authentication takes place by keys, and now, recently, by a strange coincidence, the machine stopped letting me in as master, but without any problems it lets me in as slave. That being said, if I make #su master from a slave, then I can ssh into master again. Until I break the ssh slave session. For connection I use Putty.
Tell me, please, how to solve this, or at least in which direction to dig?
Answer the question
In order to leave comments, you need to log in
So, I finally overcame this case. gaelpa was right, ~/master was encrypted. But since I didn't do it myself, so I didn't know it. I found this by noticing the .ecryptfs folder in /home.
Another problem that I solved in the appendage: in my AuthorizedKeysFile ~/.ssh/authorized_keys config, which stopped working at some point, because this file began to be looked for in /home/root regardless of the user. For everything to work, you need to leave it as it was by default, i.e.: %h /.ssh/authorized_keys
Thanks to everyone who helped!
1. use verbose mode in ssh, for example, connect from a unix server or from ubunta itself to yourself (by logging in as a slave):
# ssh -v [email protected]
2. look at the logs in /var/log/ especially auth.log , security.log, messages.log
3. look at the contents of ~master/.ssh/ maybe there, besides the keys, some non-standard configs or rc-scripts.
4. look in /etc/ssh/, maybe you will find something in sshd_config or maybe there is an sshrc script there
the rights to ~master/.ssh and ~master/.ssh/authorized_keys
should be 700 and 600 respectively.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question