简体   繁体   中英

How to create ansible master on GCP VM instance?

I tried to create ansible master on instance-1 in GCP. And I have an application instance-2. When I try to connect from instance-1 to instance-2 I always get error message - Permission denied (publickey).

I added instance-2 ssh public key to authorized_keys and configured parameter PasswordAuthentication to yes in sshd_config. In ansible file I have this:

 sba ansible_host=35.**.57.** ansible_user=admin 
 ansible_ssh_private_key_file=/home/admin/.ssh/app_gcp

Also I can't do sudo ssh-copy-id 35.111.57.111

The problem was in wrong ansible_ssh_private_key_file. It should point on the id_rsa of the current machine.

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