Ansible: SSH Configuration

Ansible SSH configuration

SSH Configuration

Configure ssh connection, on both Ansible server and Node servers.

Ansible Machine:

Generate a key, see the steps below.

$sudo su -

#ls –l

#cd  .ssh 

#ssh-keygen

#ssh-copy-id  root@node-1-ip 

#ssh-copy-id root@node-2-ip

#ssh root@node-1-ip

#ssh root@node-2-ip

Node-1

Create passwords, configure sshd file and start services.

To create the password,

#passwd root  ----->provide password

Edit the sshd_config file, In this Configuration file enable the Permit root login and Password authentification.

#vi /etc/ssh/sshd_config   ,

Permit root login  yes

password authentification yes

Restart the sshd service.

#systemctl restart sshd

Get the Ip address

#hostname –i   or   ip  a   or  ifconfig

 

Node-2

Follow the same steps on Node 2 used on Node 1.

Create the password,

#passwd root  ----->provide password

Edit the sshd_config file, In this Configuration file enable the Permit root login and Password authentification.

#vi /etc/ssh/sshd_config   ,

Permit root login  yes

password authentification yes

Restart the sshd service.

#systemctl restart sshd

Get the Ip address

#hostname –i   or   ip  a   or  ifconfig

Venkata Narayana Yarava

Venkata Narayana Yarava is an experienced Cloud DevOps Engineer with exposure to various technologies, he has a experience in DevOps Training and with different IT environments. He has a huge passion for automation technologies, specifically DevOps Tools, OpenStack, AWS, Linux, open source software. If you enjoy our articles please support us and make a small contribution: Buy Us A Coffee