Can't SSH in as root user

I am getting Permission Denied when I try to SSH in with a password.

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

Add root to AllowUsers ftponly and restart ssh

Also,

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?

EDIT: Decided to rebuild the box with admin user for root stuff so life is sweet again.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct