一、安装ansible准备
//安装准备 1.两台机器 172.7.15.106 172.7.15.111 2.设置hostname以及hosts 172.7.15.106 web9.lulu.com 172.7.15.111 web10.lulu.com 3. 安装ansible (只需要在106--server端安装) [[email protected] ~]# yum install -y epel-release [[email protected] ~]# yum install -y ansible
二、安装ansible
//106 [[email protected] ~]# ssh-keygen -t rsa //直接回车生成密钥对 Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): //此处输入密码 Enter passphrase (empty for no passphrase): [[email protected] ~]# scp .ssh/id_rsa.pub 172.7.15.111:/root/ssh/authorized_keys [[email protected] ~]# cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized.keys [[email protected] ~]# chmod 600 /root/.ssh/authorized.keys [[email protected] ~]# setenforce 0 [[email protected] ~]# iptables -F
时间: 2024-11-09 07:45:46