Couple of things you can try checking. The /etc/passwd
file to check if a shell was set as well as check the root user .profile
and .bashrc
files may have something in there preventing you from logging in.
Edit
@Burgi. The /etc/passwd
file would have the shell that the user logs in as. Typically you would have /bin/bash
or some other relevant shell. Once the user logins that shell environment in the passwd file associated with it will be executed and user session runs with that shell. However, if there was no valid shell, then the user would not be able to login as there no valid shell environment to login as. There is also /sbin/nologin
as well which "displays a message that an account is not available and exits non-zero. It is intended as a replacement shell field to deny login access to an account." man nologin
for more details. You can also use /bin/false
to get a similar effect. Check Chroot for SFTP.
With the .profile
and .bashrc
files there are executable so if had logout
for example in those files it would cause the user to logout. Since this happens at the login it would appear as though the user is not logging in.
Hope this was useful.
-vvv
switch? This will print detailed steps of the remote session and you will see where/why it fails.-l root
?service sshd restart
/var/log/auth.log
sshd
log file (if you're on Ubuntu, for example). Maybe It's just a wrong key enabled or a misconfiguration of modes. If you copy-paste some lines of log related to your attempt connecting usingroot
we can help you.