Chinaunix首页 | 论坛 | 博客
  • 博客访问: 134174
  • 博文数量: 94
  • 博客积分: 1572
  • 博客等级: 上尉
  • 技术积分: 925
  • 用 户 组: 普通用户
  • 注册时间: 2010-08-04 00:03
文章分类

全部博文(94)

文章存档

2011年(94)

我的朋友

分类: LINUX

2011-04-07 14:13:08

ssh可以使用密钥对互相建立信任,以后再链接信任的计算机就不需要输入密码了。

1、建立密钥对
niu@niu:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/niu/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/niu/.ssh/id_rsa.
Your public key has been saved in /home/niu/.ssh/id_rsa.pub.
The key fingerprint is:
27:00:f4:ce:a0:6f:61:a8:55:27:af:9a:bc:2b:d5:21 niu@niu
niu@niu:~$
过程中就一直按回车即可。此时会在 /home/niu/.ssh/ 目录下生成一对文件 id_rsa, id_rsa.pub

2、配置远程计算机
将id_ras.pub文件复制到远程计算机待登录用户个人目录下的.ssh目录中(如不存在自己创建),并将文件名改为 authorized_keys

3、完成

阅读(276) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~