ubuntu12.04-- ssh免密码登录
2016-09-26 13:44
197 查看
1.将当前主机A的用户切换为root用户
2.执行ssh-keygen -t rsa,默认三次回车
root@wifi:~# 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:
f0:d2:f8:49:66:c4:e6:40:dc:9a:0f:79:ae:72:e8:6e root@wifi
The key's randomart image is:
+--[ RSA 2048]----+
| ... |
| .... |
| o++ |
| =X. |
| o=S |
| *o. |
| . .o |
| E o |
| +oo |
+-----------------+
3.将/root/.ssh/id_rsa.pub拷贝到主机B的对应目录下,然后将其内容导入到文件authorized_keys中
cd /root/.ssh
cat id_rsa.pub > authorized_keys
4.重启sshd服务
2.执行ssh-keygen -t rsa,默认三次回车
root@wifi:~# 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:
f0:d2:f8:49:66:c4:e6:40:dc:9a:0f:79:ae:72:e8:6e root@wifi
The key's randomart image is:
+--[ RSA 2048]----+
| ... |
| .... |
| o++ |
| =X. |
| o=S |
| *o. |
| . .o |
| E o |
| +oo |
+-----------------+
3.将/root/.ssh/id_rsa.pub拷贝到主机B的对应目录下,然后将其内容导入到文件authorized_keys中
cd /root/.ssh
cat id_rsa.pub > authorized_keys
4.重启sshd服务
相关文章推荐
- ubuntu12.04下设置ssh无密码登录
- linux中ssh使用rsa免密码登录方法
- SSH无密码登录
- 关闭ssh密码登录
- 用expect实现SCP/SSH自动输入密码登录
- ssh 免密码登录
- SSH无密码登录脚本
- SSH免密码登录的配置
- 使用ssh-keygen和ssh-copy-id三步实现SSH无密码登录
- ssh 远程无密码登录
- ssh 无密码登录
- ubuntu创建ssh无密码登录
- 基于cron、rsync和ssh免密码登录实现Linux系统间自动同步~
- 用ssh-keygen来设置ssh无密码登录
- ssh配置无密码登录
- SSH免密码登录
- Mac下到Linux主机ssh免密码登录
- 服务器A 登录服务器B 免密码(ssh互信)
- 零基础Linux教程第四课“SSH密匙登录Linux,WinSCP教程,修改Linux用户密码”