SSH服务器之间信任关系!/usr/bin/ssh-copy-id: ERROR: No identities found
2015-08-31 17:06
567 查看
服务器之间SSH相互信任
(新手帖!大神勿喷)作为运维人员 经常会用到 ssh-copy-id
在使用ssh-copy-id的时候最有可能碰到的一个问题就是ssh报错:
/usr/bin/ssh-copy-id: ERROR: No identities found
下面将我配置的给大家贴上 然后再说这个报错
1、
[postgres@db1 ~]$ ssh-keygen -t rsaGenerating public/private rsa key pair.
Enter file in which to save the key (/home/postgres/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/postgres/.ssh/id_rsa.
Your public key has been saved in /home/postgres/.ssh/id_rsa.pub.
The key fingerprint is:
42:25:97:b5:cc:1d:88:d8:47:d0:ad:b9:b2:b4:1b:22 postgres@db1
备注:敲入这个ssh-keygen -t rsa命令后一路回车就行 不用设置其他 如果设置了连接的时候可能会报错上面这个错误,因为当时我设置了 系统将我的公钥,私钥直接放在了、/home/postgres 下面 而不是/home/postgres/.ssh里面 创建完直接vi /home/postgres/.ssh就能看见你的公钥和私钥了。
2、
接下来就是连接[postgres@db1 ~]$ ssh-copy-id postgres@192.168.128.129
/usr/bin/ssh-copy-id: ERROR: No identities found
这个命令有时候也会报着个错误。
换成
ssh-copy-id -i ~/.ssh/id_rsa.pub postgres@192.168.128.129 即可
但是!!!键入命令后提示(如果你没有跳出这个提示,请跳过这个步骤直接下一步)
reverse mapping checking getaddrinfo for bogon failed - POSSIBLE BREAK-IN ATTEMPT!
3、
这个时候在你的直接 vi /etc/hosts 在里面添加[root@db1 ~]# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 db1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.128.128 db1
192.168.128.129 db2
~
保存退出。
4、
完了之后重新连接即可[postgres@db1 ~]$ ssh-copy-id -i ~/.ssh/id_rsa.pub postgres@192.168.128.129
30
postgres@192.168.128.129's password: (这个地方要输入要连接的用户的密码)
Now try logging into the machine, with "ssh 'postgres@192.168.128.129'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
[postgres@db1 ~]$ ssh postgres@192.168.128.129
Last login: Mon Aug 31 22:16:08 2015 from 192.168.128.128
[postgres@db2 ~]$ exit
logout
相关文章推荐
- Hadoop第13周练习—HBase作业
- linux安装php环境
- maven redeploy过程无法删除Tomcat旧项目的目录
- Hadoop第12周练习—HBase安装部署
- Linux平台上搭建apache+tomcat负载均衡集群
- Hadoop第11周练习—HBase基础知识
- Hadoop第10周练习—Mahout部署及进行20newsgroup数据分析例子
- Linux下gdb调试程序之堆栈跟踪
- SELinux入门教程
- Linux下使用wget下载jdk
- CentOS 7 下的 Firewall
- (总结)Nginx/LVS/HAProxy负载均衡软件的优缺点详解
- [小技巧] 查询 shell 内置命令的用法
- Hadoop第8周练习—Pig部署及统计访问日志例子
- Linux内核空间映射到用户空间
- Hadoop第7周练习—MapReduce进行数据查询和实现推简单荐系统
- 从 Linux 内核访问用户空间内存
- Hadoop第6周练习—在Eclipse中安装Hadoop插件及测试(Linux操作系统)
- Linux Squid安装配置指南
- Hadoop第5周练习—MapReduce计算气象温度等例子