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 ...
随机推荐
- CentOS7 默认防火墙firewalld
firewalld基础 firewalld是CentOS7源生支持的防火墙,firewalld最大的好处有两个:支持动态更新,不用重启服务:第二个就是加入了防火墙的“zone”概念. firewall ...
- ResNeXt——与 ResNet 相比,相同的参数个数,结果更好:一个 101 层的 ResNeXt 网络,和 200 层的 ResNet 准确度差不多,但是计算量只有后者的一半
from:https://blog.csdn.net/xuanwu_yan/article/details/53455260 背景 论文地址:Aggregated Residual Transform ...
- phpstorm 代码按列对齐
设置方式: Preference... -> Editor -> CodeStyle -> PHP -> Other -> Align key-value pairs
- MySQL交叉表处理_20160923
交叉表处理,在二维表中例如下面表 想把年月字段放到列字段,在sql中可以使用sum(if(条件,求和字段,null)) 函数来进行行列的转置 1.首先是上篇的年月字段在一列 SELECT city A ...
- boost库安装和使用
1. 下载最新的boost库:http://www.boost.org/本文使用的是boost_1_66_0.tar.gz, 2. Boost库安装步骤: > 解压下载文件,例如下载文件在~/D ...
- cookie,sessionStorage 和 localStorage
1.三者之间的区别 cookie是网站为了标示用户身份而储存在用户本地终端(Client Side)上的数据(通常经过加密). cookie数据始终在同源的http请求中携带(即使不需要),记会在浏览 ...
- NLB
http://www.cnblogs.com/allegro/archive/2011/02/11/1951171.html
- hadoop版本与支持的hbase版本对照…
hadoop版本与支持的hbase版本对照表 分类: hbase2013-05-20 17:19 701人阅读 评论(2) 收藏 举报 HbaseHadoop As of Hive 0.9.0 the ...
- HDU - 5094 Maze(状压+bfs)
Maze This story happened on the background of Star Trek. Spock, the deputy captain of Starship Enter ...
- Zookeeper发布订阅之SpringBoot+Mybatis多数据源
1.前言 数据发布/订阅系统,即所谓的配置中心,顾名思义就是发布者将数据发布到Zookeeper的一个或一系列节点上,供订阅者进行数据订阅,进而达到动态获取数据的目的,实现配置信息的集中管理和数据的动 ...