1

I think I, somehow, made too many attempts trying to login to my root@server using ssh. SSH is now asking for a public key authentication, which I have never set up.

How do I log back in to my server, and how do I permanently disable public key authentication (yes, I know the risks and I'm willing to take them).

I'm using OpenSSH.

Log:ssh -vvv root@server

    Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/private/.ssh/id_rsa
debug3: no such identity: /home/private/.ssh/id_rsa: No such file or directory
debug1: Trying private key: /home/private/.ssh/id_dsa
debug3: no such identity: /home/private/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/private/.ssh/id_ecdsa
debug3: no such identity: /home/private/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /home/private/.ssh/id_ed25519
debug3: no such identity: /home/private/.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
root@server's password: 
debug2: we sent a password packet, wait for reply
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
  • 3
    Are you sure password auth is enabled for root? Because it's not by default. – Daniel B Apr 26 '16 at 16:31
  • God... knowledge is power. I just logged in from another user and yes, you're right, it was disabled. Please add your answer. – Mars Apr 26 '16 at 16:36
1

OpenSSH changed the default value for the PermitRootLogin option with the release of version 7.0 (August 2015). The new default value is prohibit-password. Previously, the value was yes.

Regular users can still authenticate with passwords by default.

Also, while public key authentication could indeed by disabled (PubkeyAuthentication option), there’s no benefit to doing so unless you enable some other authentication method. Unless the AuthenticationMethods option doesn’t require users to pass multiple methods, any will suffice.

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.