SlideShare a Scribd company logo
Objective
As a DevOps Engineer I want to set up Configuration Management
System using Ansible. I have Two Target Machine and One Ansible
Control node.
I want to setup SSH between Ansible Control node with that of Target
Node
Ansible-Control-Node
Private-Key Public-Key
Target-Node-1
Private-Key Public-Key
Target-Node-2
Private-Key Public-Key
//copy
// whoare allowedtoaccessme
Ansible-Control-Node
Public-Key
// whoare allowedtoaccessme
Ansible-Control-Node
Public-Key
authorized_keys
authorized_keys
1. Generate your keys (Ansible Control Node // It wants to access target)
//Login to Ansible Node
sudo su
// generate the keys
ssh-keygen -t rsa
//i.e it will generate 2 files id_rsa.pub(public key) and id_rsa(private key) at location /root/.ssh/
2. Create a file "authorized_keys" at the root user's .ssh directory .
Change the .ssh directory mode to 700(executable) and authorized_keys file mode 600(read & write)
//Login to Target Node
sudo su
//create a file named "authorized_keys" at /root/.ssh/ (if not present already)
touch authorized_keys
//Change the /root/.ssh mode to 700 and authorized_keys file mode to 600
chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys/
3. Add the Ansible public key to the "authorized_keys"of the Target Node
// Login to the target node
sudo su
vi /root/.ssh/authorized_keys
//move to end , press enter copy the public key and paste here, save exit
4. Optional(restrict the password authentication)
//Login to Target Node
sudo su
vi /etc/ssh/sshd_config
//change the line PasswordAuthentication yes to no

More Related Content

PDF
Art of listening
PDF
Copying files between linux machines using scp and ssh without linux user pas...
ODP
Ansible basics workshop
PPTX
Arcshell SSH Module Overview
PDF
Chef 0.10 Overview
PDF
Haskell Packageのdeb化
PPTX
DRUPAL Search API Solr
PDF
10 Useful Asciidoctor Tips
Art of listening
Copying files between linux machines using scp and ssh without linux user pas...
Ansible basics workshop
Arcshell SSH Module Overview
Chef 0.10 Overview
Haskell Packageのdeb化
DRUPAL Search API Solr
10 Useful Asciidoctor Tips

What's hot (19)

PPTX
Efficient DBA: Gain Time by Reducing Command-Line Keystrokes
KEY
ISUCONアプリを Pythonで書いてみた
PDF
Sydney Python Presentation (October 2010) - Splunk
PDF
ARCでめちゃモテiOSプログラマー
DOCX
Article on shellshock
TXT
Cluster setup multinode_aws
PPTX
Bower introduction
PPT
Dance for the puppet master: G6 Tech Talk
PDF
Hacking ansible
PPTX
Gnu build system
PPTX
How to create a secured multi tenancy for clustered ML with JupyterHub
PDF
Gitlab installation
PPTX
How to go the extra mile on monitoring
PDF
Введение в REST API
PDF
Денис Лебедев-Управление зависимостями с помощью CocoaPods
PDF
Play á la Rails
PDF
Integrate Hue with your Hadoop cluster - Yahoo! Hadoop Meetup
PDF
Интуит. Разработка приложений для iOS. Лекция 11. Расширенные возможности уст...
PDF
V2 and beyond
Efficient DBA: Gain Time by Reducing Command-Line Keystrokes
ISUCONアプリを Pythonで書いてみた
Sydney Python Presentation (October 2010) - Splunk
ARCでめちゃモテiOSプログラマー
Article on shellshock
Cluster setup multinode_aws
Bower introduction
Dance for the puppet master: G6 Tech Talk
Hacking ansible
Gnu build system
How to create a secured multi tenancy for clustered ML with JupyterHub
Gitlab installation
How to go the extra mile on monitoring
Введение в REST API
Денис Лебедев-Управление зависимостями с помощью CocoaPods
Play á la Rails
Integrate Hue with your Hadoop cluster - Yahoo! Hadoop Meetup
Интуит. Разработка приложений для iOS. Лекция 11. Расширенные возможности уст...
V2 and beyond
Ad

Similar to Ssh between ansible control node with that of target (20)

PPTX
BuildStuff.LT 2018 InSpec Workshop
PDF
How To Setup SSH Keys on CentOS 7
PPTX
InSpec Workshop at Velocity London 2018
DOCX
Clustering manual
PPTX
DevOpsDays InSpec Workshop
PPT
Ansible presentation
PPTX
Linux privesc.pptx
PDF
Hadoop 2.0 cluster setup on ubuntu 14.04 (64 bit)
PPT
Introduction to SSH
PDF
SSH how to 2011
PPTX
Ansible as configuration management tool for devops
PDF
OpenSSH tricks
PDF
Linux advanced privilege escalation
PDF
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
DOCX
Cent os 5 ssh
PDF
Ansible_Basics_ppt.pdf
PPTX
DevSecCon London 2017: Inspec workshop by Mandi Walls
PPTX
InSpec Workshop DevSecCon 2017
PDF
Ssh cookbook v2
PDF
Ssh cookbook
BuildStuff.LT 2018 InSpec Workshop
How To Setup SSH Keys on CentOS 7
InSpec Workshop at Velocity London 2018
Clustering manual
DevOpsDays InSpec Workshop
Ansible presentation
Linux privesc.pptx
Hadoop 2.0 cluster setup on ubuntu 14.04 (64 bit)
Introduction to SSH
SSH how to 2011
Ansible as configuration management tool for devops
OpenSSH tricks
Linux advanced privilege escalation
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
Cent os 5 ssh
Ansible_Basics_ppt.pdf
DevSecCon London 2017: Inspec workshop by Mandi Walls
InSpec Workshop DevSecCon 2017
Ssh cookbook v2
Ssh cookbook
Ad

Recently uploaded (20)

PPTX
Spectroscopy.pptx food analysis technology
PPTX
1. Introduction to Computer Programming.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Approach and Philosophy of On baking technology
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Getting Started with Data Integration: FME Form 101
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
A Presentation on Artificial Intelligence
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Spectroscopy.pptx food analysis technology
1. Introduction to Computer Programming.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Mobile App Security Testing_ A Comprehensive Guide.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Approach and Philosophy of On baking technology
Encapsulation_ Review paper, used for researhc scholars
Reach Out and Touch Someone: Haptics and Empathic Computing
“AI and Expert System Decision Support & Business Intelligence Systems”
Getting Started with Data Integration: FME Form 101
Digital-Transformation-Roadmap-for-Companies.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
A Presentation on Artificial Intelligence
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Per capita expenditure prediction using model stacking based on satellite ima...
Spectral efficient network and resource selection model in 5G networks
Dropbox Q2 2025 Financial Results & Investor Presentation
Agricultural_Statistics_at_a_Glance_2022_0.pdf

Ssh between ansible control node with that of target

  • 1. Objective As a DevOps Engineer I want to set up Configuration Management System using Ansible. I have Two Target Machine and One Ansible Control node. I want to setup SSH between Ansible Control node with that of Target Node
  • 2. Ansible-Control-Node Private-Key Public-Key Target-Node-1 Private-Key Public-Key Target-Node-2 Private-Key Public-Key //copy // whoare allowedtoaccessme Ansible-Control-Node Public-Key // whoare allowedtoaccessme Ansible-Control-Node Public-Key authorized_keys authorized_keys
  • 3. 1. Generate your keys (Ansible Control Node // It wants to access target) //Login to Ansible Node sudo su // generate the keys ssh-keygen -t rsa //i.e it will generate 2 files id_rsa.pub(public key) and id_rsa(private key) at location /root/.ssh/ 2. Create a file "authorized_keys" at the root user's .ssh directory . Change the .ssh directory mode to 700(executable) and authorized_keys file mode 600(read & write) //Login to Target Node sudo su //create a file named "authorized_keys" at /root/.ssh/ (if not present already) touch authorized_keys //Change the /root/.ssh mode to 700 and authorized_keys file mode to 600 chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys/
  • 4. 3. Add the Ansible public key to the "authorized_keys"of the Target Node // Login to the target node sudo su vi /root/.ssh/authorized_keys //move to end , press enter copy the public key and paste here, save exit 4. Optional(restrict the password authentication) //Login to Target Node sudo su vi /etc/ssh/sshd_config //change the line PasswordAuthentication yes to no