abinav raam
abinav raam

Reputation: 3

linux azure vm created using chef asking ssh password while trying to bootstrap even rsa file is given?

code for creating the instance

knife azure server create  --azure-dns-name 'azurelocalinstance' --azure-vm-name 'LinuxInstance' --azure-vm-size Medium -I 03f55de797f546a1b29d1b8d66be687a__Jenkins272-Ubuntu1404LTS2016-09-13 --azure-service-location "Southeast Asia" --ssh-user myuser --identity-file D:/ACE_Dev/Keys/AZURE_LINUX_KEYS/azure_linux_id_rsa

Waiting for virtual machine to reach status 'provisioning'.................vm state 'provisioning' reached after 2.87 minutes.

DNS Name: azurelocalinstance.cloudapp.net
VM Name: LinuxInstance
Size: Medium
Azure Source Image: 03f55de797f546a1b29d1b8d66be687a__Jenkins272-Ubuntu1404LTS2016-09-13
Azure Service Location: Southeast Asia
Public Ip Address: 13.76.143.3
Private Ip Address: 100.104.98.32
SSH Port: 22
Environment: _default

Waiting for sshd on 13.76.143.3:22done

Connecting to 13.76.143.3
Password: 
Failed to authenticate myuser - trying password auth
Enter your password:
ERROR: Net::SSH::AuthenticationFailed: Authentication failed for user [email protected]@13.76.143.3

Error the problem i faced was while trying to bootstrap the ssh authentication fails even though the rsa file is specified

the rsa key is genereated by the following code

ssh-keygen -t rsa -b 4096 -C "[email protected]"

any help is appreciated in advance

Upvotes: 0

Views: 429

Answers (1)

coderanger
coderanger

Reputation: 54251

You need to configure the SSH key on the Azure side too. Simply providing a private key does nothing if the server is not configured to accept it. Knife automatically falls back to password authentication if the key fails (to mimic the behavior of OpenSSH).

Upvotes: 1

Related Questions