0

I'm trying to set-up passwordless ssh into localhost. Following is the output of ssh -v localhost.

 OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017
debug1: Reading configuration data /home/nelwinjacob/.ssh/config
debug1: /home/nelwinjacob/.ssh/config line 19: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to localhost [127.0.0.1] port 22.
debug1: Connection established.
debug1: identity file /home/nelwinjacob/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file /home/nelwinjacob/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/nelwinjacob/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/nelwinjacob/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/nelwinjacob/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/nelwinjacob/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/nelwinjacob/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/nelwinjacob/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
debug1: Remote protocol version 2.0, remote software version MS_1.100
debug1: no match: MS_1.100
debug1: Authenticating to localhost:22 as 'nelwinjacob'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: ecdh-sha2-nistp256
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:Yh0dgFNA0eNWegL6+G0FZePrNV+HVKN4u6jIK3IYaPE
debug1: Host 'localhost' is known and matches the RSA host key.
debug1: Found key in /home/nelwinjacob/.ssh/known_hosts:1
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: gssapi-with-mic,password
debug1: No more authentication methods to try.
nelwinjacob@localhost: Permission denied (gssapi-with-mic,password).

It is expected that the line Authentications that can continue: gssapi-with-mic,password should show publickey but publickey authentication doesn't seem to work here.

Directory and file permissions are good.

I have enabled publickeyauthentication and disabled gssapi authentication in the config file but I'm running into the same issue.

Any pointers towards this?

UPDATE: I have got it to work by using a different port. I'm being prompted for password on using the default port 22 but it connects successfully on using a different port.

What could be the possible reasons?

  • Can you update your output to use ssh -vvv localhost (that is, with three -v options) instead? That output provides additional debugging information which will be helpful here. – bk2204 Jun 28 at 19:08

Your Answer

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

Browse other questions tagged or ask your own question.