Skip to content

Instantly share code, notes, and snippets.

@f9n
Last active October 22, 2017 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save f9n/d9826017c1d5b9d31bf92b181026a5e6 to your computer and use it in GitHub Desktop.
Save f9n/d9826017c1d5b9d31bf92b181026a5e6 to your computer and use it in GitHub Desktop.
Ansible Ssh Config

For Slaves

You must install openssh-server to slave machines.

$ sudo apt-get install openssh-server

Then, restart sshd service

$ sudo systemctl restart sshd

If slave machine user is not root, you must give privileges like 'sudo'

$ echo "<slave_machine_user> ALL = NOPASSWD : ALL" >> /etc/sudoers

You must be carefull, if your machine doesnt have root user.

For Master

Generate ssh key

$ ssh-keygen

Copy ssh key to slave machines

$ ssh-copy-id -i <slave_machine_name>@<slave_machine_ip>

sign_and_send_pubkey: signing failed: agent refused operation

$ ssh-add
$ ssh-add -l

Then connect

ssh <slave_machine_name>@<slave_machine_ip>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment