简体   繁体   中英

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 myuser@13.76.143.3@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 "your_email@example.com"

any help is appreciated in advance

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM