ubuntu上安装ansible
1 在最新的ubuntu系统上安装ansible : sudo ape-get install ansible
2 切换到root用户 生成ssh免密登陆
ssh-keygen -t rsa
ssh-copy-id -i /root/.ssh/id_rsa.pub root@ip(ip是被ansible管理的节点地址)
root@pxy-p:/etc/ansible# 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):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:AsNJM46Bt5GCyQtaNXQOik+hKDAD9hRQZkIuMz3I/1g root@pxy-p
The key's randomart image is:
+---[RSA 2048]----+
|XB=XX . |
|%O@O O |
|%*B+* . |
|+*o. o |
| .. E. S |
| + . |
| . . |
| |
| |
+----[SHA256]-----+
root@pxy-p:/etc/ansible# ssh-copy-id -i /root/.ssh/id_rsa.pub root@100.98.40.134
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@100.98.40.134's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'root@100.98.40.134'"
and check to make sure that only the key(s) you wanted were added. root@pxy-p:/etc/ansible# ssh 100.98.40.134
Welcome to Ubuntu 16.04.5 LTS (GNU/Linux 4.15.0-29-generic x86_64) * Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage 6 个可升级软件包。
0 个安全更新。 Last login: Tue Oct 30 16:29:25 2018 from 100.98.40.167
root@pxy-snow:~# exit
注销
Connection to 100.98.40.134 closed.
root@pxy-p:/etc/ansible#
如果ssh 免秘钥登陆节点失败:
解决方法:
1) 以root身份,chmod +w /etc/ssh/sshd_config
2) vi /etc/ssh/sshd_config
3) 将PermitRootLogin no改成PermitRootLogin yes
4) service sshd restart
ubuntu上安装ansible的更多相关文章
- [异常解决] ubuntu上安装JLink驱动遇到的坑及给后来者的建议
一.前言 最近将整个电脑格式化,改成了linux操作系统 希望这样能让自己在一个新的世界探索技术.提升自己吧- win上的工具用多了,就不想变化了- 继上一篇<ubuntu上安装虚拟机遇到的问题 ...
- Ubuntu上安装Robomongo及添加到启动器
到目前为止,Robomongo仍是MongoDB最好的客户端管理工具,如需在Ubuntu上安装Robomongo,可直接从官网下载.tar.gz压缩包进行解压,然后直接运行bin目录下的robomon ...
- 在 Ubuntu 上安装 Android Studio
在 Ubuntu 上安装 Android Studio http://www.linuxidc.com/Linux/2013-05/84812.htm 打开terminal,输入以下命令 sudo a ...
- Ubuntu上安装Karma失败对策
在Ubuntu上安装Karma遇到超时 timeout 错误.Google了一下,国外的码农给了一个快捷的解决方案,实测可行,贴在这里: sudo apt-get install npm nodejs ...
- 在Ubuntu上安装LAMP服务器
1.安装Ubuntu上安装LAMP apt-get install lamp-server^ 2.安装过程中设置MySql密码 3.测试 创建index.php var/www/html/index. ...
- [译]How to Setup Sync Gateway on Ubuntu如何在ubuntu上安装sync-gateway
参考文章https://hidekiitakura.com/2015/03/21/how-to-setup-sync-gateway-on-ubuntudigitalocean/ 在此对作者表示感谢 ...
- 在Ubuntu上安装JDK、Ant、Jmeter和Jenkins
一.前期准备 1. 在win7下载VMware.Ubuntu(用迅雷下比较快) 2. 安装完VMware后新建虚拟机,选择iso: 3. 具体配置参考如下,至此Ubantu安装完成 二.在Ubuntu ...
- Ubuntu上安装MongoDB(译)
add by zhj:直接从第四步开始就可以了,而且安装好MongoDB后会自动启动的,不必自己去执行启动命令 原文:https://docs.mongodb.com/manual/tutorial/ ...
- Ubuntu上安装ns2-2.34
Ubuntu上安装ns2-2.34 步骤1 下载ns-allinone-2.34 $ tar zxf ns-allinone-2.34.tar.gz 步骤2 sudo apt-get install ...
随机推荐
- 分享知识-快乐自己:SpringMvc中的四种数据源及相关配置(整合快速集成开发)
数据库连接: jdbc.driver=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://39.105.105.186:3306/SpringMybatis?us ...
- Zabbix监控华为交换机
一. 监控交换机首先要在交换机开通snmp协议. 有两种方式开通,web界面,及交换机的配置界面 Web界面开通: 交换机配置界面 有web界面的,使用web界面相对简单,本项目就是用web界面 ...
- 疑难杂症:“代理 XP”组件已作为此服务器安全配置的一部分被关闭。系统管理员可以使用 sp_configure 来启用“代理 XP”。
“代理 XP”组件已作为此服务器安全配置的一部分被关闭.系统管理员可以使用 sp_configure 来启用“代理 XP”.有关启用“代理 XP”的详细信息,请参阅 SQL Server 联机丛书中的 ...
- xpath normalize-sapce 函数的Java实现
normalize-space函数实现的功能是:删除字符串前后空格,中间的空格有多个只保留一个. 1. 用Java正则表达式 public static String normalizeSpace(S ...
- bjwc Day2 玄学
早晨起来很开心,因为昨天跟妹子聊天聊到很晚 然后看到了题,感觉:这tm才是冬令营呀! T1构造,并没有找到性质,暴力都懒得打 T2数位dp,状态比较麻烦,看来跟dmy想到一起了,然后搞一下搞完 T3放 ...
- Java命名规范(简略)
1.包 全部小写,由域名定义前缀. 例如:teach.golddrem.javagroup 2.类 开头字母大写,后边每个单词的首字母都大写.如果有缩写,缩写部分全部大写. 例如:Informatio ...
- CF331B Cats Transport[斜率优化dp+贪心]
luogu翻译 一些山距离起点有距离且不同,m只猫要到不同的山上去玩ti时间,有p个铲屎官人要去把所有猫接走,步行速度为1单位每秒,从1走到N座山不停下,必须在猫玩完后才可以把他带走.可以提前出发.问 ...
- 图形化升级单机oracle 11.2.0.1 到 11.2.0.4
1. 讲补丁包上传到 oracle server ,解压.安装 [root@11g ~]#unzip p13390677_112040_Linux-x86-64_1of7.zip -d /tmp &a ...
- JZOJ 1667【AHOI2009】中国象棋——dp
题目:https://jzoj.net/senior/#main/show/1667 只注重0.1.2的列有多少个,不注重它们的位置,就能记录了. #include<iostream> # ...
- docker基于宿主机系统版本创建镜像
这里讲如何定制自己centos镜像,仅供测试docker使用. A) 安装软件 yum -y install febootstrap B)下载镜像febootstrap -i bash -i wget ...