I am using ssh-keygen and giving no pass phrase then key-fingerprint is successfully generated and shown.
Then I'm giving ssh-copy-id user@localhost then its prompting for my user's password after providing it states Number of key(s) added : 1.
Now if I'm doing ssh localhost its again prompting for password.
also If I do ssh user@localhost it asks for password.
PS : I have used : ssh-add and also sudo ufw allow 22 nothing seems to work fine everytime I do ssh localhost I have been prompted with password.
[EDIT]
ssh -v localhost
shows
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr [email protected] none
debug1: kex: client->server aes128-ctr [email protected] none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA b2:58:a9:da:84:3f:43:1c:86:51:ba:cd:b7:88:a3:74
debug1: Host 'localhost' is known and matches the ECDSA host key.
debug1: Found key in /home/harsh/.ssh/known_hosts:1
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering DSA public key: /home/harsh/.ssh/id_dsa
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: /home/harsh/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/harsh/.ssh/id_ecdsa
debug1: Trying private key: /home/harsh/.ssh/id_ed25519
debug1: Next authentication method: password
harsh@localhost's password:
.ssh/authorized_keysfile? - knittlssh -v user@localhostand inspect debug output to see what private keys are tried by ssh client, and what are the outcomes. - mephi42.ssh/id_ecdsaand.ssh/id_ed25519and then it shows Next authentication method : password - Harsh Vardhan Ladha