ssh免密码登录实验
2011-05-30 11:14
92 查看
客户机:10.1.29.15
目标机:10.1.29.75 用户名:root 密码:f
从客户机登录到目标机
在客户机上生成密钥,一直敲回车即可,把公钥/root/.ssh/id_rsa.pub拷贝到目标主机。
先登录目标主机。
放入授权文件.ssh/authorized_keys中,保证对~/.ssh和~/.ssh/id_rsa* ~/.ssh/authorized_keys都有写权限。
然后退出再登录,就不用密码了。
目标机:10.1.29.75 用户名:root 密码:f
从客户机登录到目标机
在客户机上生成密钥,一直敲回车即可,把公钥/root/.ssh/id_rsa.pub拷贝到目标主机。
root@alen:~# 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: ca:8b:af:b2:2d:07:0c:27:8d:d6:ac:02:2b:94:f0:85 root@alen The key's randomart image is: +--[ RSA 2048]----+ | . | |. E . | |.++. | |=++o | |+*. S | |+.o . . | |o . o | | o... . | | .=+oo | +-----------------+ root@alen:~# scp ~/.ssh/id_rsa.pub 10.1.29.75:~/.ssh/
先登录目标主机。
root@alen:~# ssh 10.1.29.75 root@10.1.29.75's password: Last login: Mon May 30 10:43:55 2011 from 10.1.29.15 [root@n75 ~]# cd ~/.ssh
放入授权文件.ssh/authorized_keys中,保证对~/.ssh和~/.ssh/id_rsa* ~/.ssh/authorized_keys都有写权限。
[root@n75 .ssh]# cat id_rsa.pub >> ~/.ssh/authorized_keys [root@n75 .ssh]# chmod 700 ~/.ssh [root@n75 .ssh]# chmod 600 ~/.ssh/id_rsa* ~/.ssh/authorized_keys
然后退出再登录,就不用密码了。
[root@n75 .ssh]# exit logout Connection to 10.1.29.75 closed. root@alen:~# ssh 10.1.29.75 Last login: Mon May 30 10:58:05 2011 from 10.1.29.15
相关文章推荐
- CISCO最基本的实验-路由密码设置与SSH登录设置
- CISCO实验-路由密码设置与SSH登录设置
- 集群中配置多台计算机之间ssh无密码登录的一种简便方法
- 使用ssh-keygen和ssh-copy-id三步实现SSH无密码登录
- SSH免密码登录Linux服务器
- Linux平台下安装SSH,免密码登录
- 设置SSH免密码自动登录(使用别名)
- Hadoop必经之路---Ubuntu SSH免密码登录
- install DenyHost 反登录破解ssh密码
- “光速"配置ssh免密码登录的配置
- ssh无密码登录
- linux系统SSH免密码登录--已解决
- ssh登录时不用输入密码
- Ubuntu 16.10下想要SSH免密码远程登录,为何总是需要密码?
- Hadoop集群搭建之SSH无密码登录配置
- SSH无密码登录远程主机
- ssh 无密码登录
- ubuntu 中ssh无密码配置 ,hadoop节点之间无密码登录
- CentOS 之间ssh无密码登录
- 无密码ssh登录