Search code examples
virtual-machineibm-cloud

Login to Bluemix VM suddenly asks for password


I have created a VM with a public ssh key. Once is it created, I am able to login with the private ssh key:

ssh -i cloud.key [email protected]

After some successful logins, suddenly when trying to login with the same command I am asked for a password:

$ ssh -i cloud.key [email protected]
[email protected]'s password:

Do you know why is this happening? I have removed and recreated the VM with same behaviour. After some successful logins, it started to ask for a password.

[EDITED] Added -vv verbose info:

.........
.........
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_setup: setup [email protected]
debug1: kex: server->client aes128-ctr [email protected] none
debug2: mac_setup: setup [email protected]
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 12:05:44:27:ab:c9:98:5f:45:ab:1d:d7:e0:ca:ba:3a
debug1: Host '129.41.xxx.xx' is known and matches the ECDSA host key.
debug1: Found key in /home/xxxx/.ssh/known_hosts:11
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: cloud.key (0x6000686e0), explicit
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: cloud.key
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug2: we did not send a packet, disable method
debug1: Next authentication method: password

Thanks!


Solution

  • Answering my own question.... the issue was a colleague changed home directory permissions to 777 and for some reason SSH thinks that is not secure and doesn't authenticate although -vv parameter doesn't say anything about it.

    Hope this helps others.