I operated a debian server for a while while just by permitting a publickey-based access. Unfortunately I lost the private key (reinstall without backup), and now I am not able to log into the system anymore. I am able to access the hard drive, thus I can modify data on the hard disk. I already reverted the sshd_config-file, but I still get the error when trying to log in via ssh:

Authentications that can continue: publickey

What do I have to enable in the sshd_config-file in order to enable password-based access again?


Port 234
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 768
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords yes
ChallengeResponseAuthentication no
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
Banner /etc/issue.net
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM no
  • Did you restart the ssh service on the host after modifying the configuration? – Lambert Mar 18 '16 at 13:45
  • Also verify the setting of PasswordAuthentication, if omitted, defaults to yes. – Lambert Mar 18 '16 at 13:47
  • @Lambert: The PC was shut down during change, thus I assume that the service did restart – arc_lupus Mar 18 '16 at 13:56
  • Ensure you don't have a match rule that applies to your user and/or group. – BitsOfNix Mar 18 '16 at 14:06
  • @BitsOfNix: How do I do that? – arc_lupus Mar 18 '16 at 14:35
vi /etc/ssh/sshd_config

Then set this line to:

PasswordAuthentication yes

Bringing the OS up will refresh the service and reload openssh configuration.

  • This did not work, I still get publickey as onliest auth method – arc_lupus Mar 19 '16 at 9:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.