SSH-无密码相互远程登录
2013-06-13 22:10
225 查看
linux多节点之间可以实现无密码SSH相互远程登录。原理就是在每一个节点上面用ssky-keygen生成自己的公钥和私钥,然后再把自己的公钥分别导入到其它节点上面,就可以实现无密码远程登录了。ssh-keygen 创建公钥和密钥。ssh-copy-id 把本地主机的公钥复制到远程主机的authorized_keys文件上。ssh-copy-id 也会给远程主机的用户主目录(home)和~/.ssh, 和~/.ssh/authorized_keys设置合适的权限 。(1)用 ssh-key-gen 在本地主机上创建公钥和密钥ligh@local-host$ ssh-keygen -t rsaEnter file in which to save the key (/home/jsmith/.ssh/id_rsa):[Enter key]Enter passphrase (empty for no passphrase): [Press enter key]Enter same passphrase again: [Pess enter key]Your identification has been saved in /home/jsmith/.ssh/id_rsa.Your public key has been saved in /home/jsmith/.ssh/id_rsa.pub.The key fingerprint is: 33:b3:fe:af:95:95:18:11:31:d5:de:96:2f:f2:35:f9(2)用 ssh-copy-id 把公钥复制到远程主机上ligh@local-host$ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.0.3ligh@remote-host‘s password:Now try logging into the machine, with ―ssh ?remote-host‘‖, and check in:.ssh/authorized_keys to make sure we haven‘t added extra keys that you weren‘t expecting.注: ssh-copy-id 可把公钥密钥追加到远程主机的 .ssh/authorized_key文件中如果提示:-bash: ssh-copy-id: command not found 是说明在改系统上没有该命令,此命令是由openssh-clients包安装的,在操作系统的光碟中有此包,也可以yum install openssh-clients安装。 [root@centos ~]# which ssh-copy-id
/usr/bin/ssh-copy-id
[root@centos ~]# rpm -qf /usr/bin/ssh-copy-id
openssh-clients-5.3p1-84.1.el6.x86_64
(3) 远程登入ligh@local-host$ ssh remote-hostLast login: Sun Nov 16 17:22:33 2008 from 192.168.1.2注: SSH 不会询问密码了即可远程登录主机
/usr/bin/ssh-copy-id
[root@centos ~]# rpm -qf /usr/bin/ssh-copy-id
openssh-clients-5.3p1-84.1.el6.x86_64
(3) 远程登入ligh@local-host$ ssh remote-hostLast login: Sun Nov 16 17:22:33 2008 from 192.168.1.2注: SSH 不会询问密码了即可远程登录主机
相关文章推荐
- 构建SSH远程登录管理-密码认证-免密登录
- 批量实现多台服务器之间ssh无密码登录的相互信任
- ubuntu ssh无密码登录 详解 不需要密码 多台相互 linux
- ssh无密码登录远程主机执行特定命令的注意事项
- Linux下ssh远程免密码登录
- linux下开启SSH,并且允许root用户远程登录,允许无密码登录
- ssh 远程登录 服务器 免密码 详解
- ssh无密码远程登录失败终极解决方案
- Linux下通过 ssh-copy-id 无密码远程登录主机
- CentOS6.3上SSH远程登录实现无密码认证
- ssh 远程无密码登录
- SSH关闭远程密码登录---Window&Linux客户端证书登录&window找不到ssh-keygen
- linux下开启SSH,并且允许root用户远程登录,允许无密码登录
- Linux上SSH登录远程服务器免密码
- windows下crywin SSH免密码登录到远程linux服务器详解
- 利用ssh-copy-id无需密码登录远程服务器
- ssh更改默认端口号及实现免密码远程登录
- SSH无密码登录远程主机
- linux远程登录ssh免密码
- RHCE_LAB(2)SSH远程登录自动验证(不输入用户登录密码)的实现