Failed to ssh deployed VM with correct username/password
Problem
When you failed to ssh deployed VM with correct username/password, the returned message are like:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
Explanation
The ssh is denied because password authentication in sshd is disabled.
Resolution
In the /etc/cloud/cloud.cfg
file of the source image, the ssh_pwauth config key determines whether or not sshd will be configured to accept password authentication. Setting ssh_pwauth to
1
will enable password auth, which means that PasswordAuthentication config key in /etc/ssh/sshd_config
will be set to yes
. Setting to 0
will disable password auth, the PasswordAuthentication config key will be set to no
. And the literal string unchanged
will leave sshd unchanged.
Configure the /etc/cloud/cloud.cfg
file when you create an image. See "Install and configure cloud-init"