Can't SSH in as root user
I was tweaking the /etc/ssh/sshd_config file to set up SFTP for a non root user. Then suddenly my SSH access vanished.
If I log into the LISH console then ssh in as root with password, I can get in. So the password is correct.
Below are the uncommented lines in /etc/ssh/sshd_config in case that helps.
Port 22
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 768
SyslogFacility AUTH
LogLevel DEBUG
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
PasswordAuthentication yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
AcceptEnv LANG LC_*
Subsystem sftp internal-sftp
UsePAM yes
AllowUsers ftponly
AllowGroups ftpusers
Match Group ftpusers
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
I've also done /etc/init.d/ssh restart to no effect.
Any ideas appreciated. Distro is Debian (Lenny).
3 Replies
PermitRootLogin yes
may be necessary. It was the default, not sure if still is.
May I ask why do you need to ssh in as root, instead of as some other username and then su?