0
server1.xxx.com에 대해 가능한 스크립트를 실행하려고하는데 허가가 거부되었습니다. 내가 명령권한이 부여 된 ssh에게 권한 부여가 거부되었습니다.
ssh-keygen -f t11pkey
또한 추가 한 암호를 사용하여 SSH 키를 생성 한
은 서버에 키를 복사. 내 키
ssh-copy-id -i /home/user.name/t11pkey.pub [email protected]
내 ~/스푸핑/설정
Host server?.xxx.com
User user.name
Port 22
IdentityFile /home/user.name/.ssh/t11pkey.pub
권한 :
-rw------- 1 user.name Domain Users 1766 Dec 5 10:55 t11pkey
-rw------- 1 user.name Domain Users 412 Dec 5 10:55 t11pkey.pub
ansible.cfg
[defaults]
filter_plugins =./filter_plugins
roles_path = ./roles
sudo_user = root
host_key_checking = False
retry_files_enabled = False
[ssh_connection]
ssh_args = -F /home/user.name/.ssh/config -o ControlMaster=auto -o ControlPersist=30m
control_path = ~/.ssh/ansible-%%[email protected]%%h:%%p
인벤토리 파일
[new]
server1.xxx.com
내 ansible - 각본
- hosts: new
remote_user: user.name
become: true
vars_files:
- xx.yml
- xx.yml
- xx.yml
roles:
- role: ~/path/to/the/role
Anisble 오류 :
가TASK [Gathering Facts] *****************************************************************************************************************************************************
Enter passphrase for key '/home/user.name/.ssh/t11pkey.pub':
Enter passphrase for key '/home/user.name/.ssh/t11pkey.pub':
Enter passphrase for key '/home/user.name/.ssh/t11pkey.pub':
fatal: [server1.xxx.com]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).\r\n", "unreachable": true}
이
ansible --version : config 파일에서 ansible 2.3.1.0 (stable-2.3 5512c94017) last updated 2017/06/21 22:56:43 (GMT -400)