Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3098825
  • 博文数量: 797
  • 博客积分: 10134
  • 博客等级: 上将
  • 技术积分: 9335
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-22 22:57
个人简介

1

文章分类

全部博文(797)

文章存档

2022年(1)

2021年(2)

2017年(2)

2016年(1)

2015年(4)

2014年(1)

2013年(6)

2012年(6)

2011年(10)

2010年(26)

2009年(63)

2008年(61)

2007年(51)

2006年(563)

我的朋友

分类: LINUX

2006-08-13 00:40:07

把你的本地主机用户的ssh公匙文件写入到远程主机用户的~/.ssh/authorized_keys文件中,具体方法
假设本地主机test1,远程主机test2

一,在test1主机里的用户
运行 ssh-keygen -t rsa
结果如下
Generating public/private rsa key pair.

Enter file in which to save the key (/home/.username/ssh/id_rsa):#回车

Enter passphrase (empty for no passphrase):#回车

Enter same passphrase again:#回车

Your identification has been saved in /home/.username /.ssh/id_rsa.

Your public key has been saved in /home/.username /.ssh/id_rsa.pub.

The key fingerprint is:

38:25:c1:4d:5d:d3:89:bb:46:67:bf:52:af:c3:17:0c username@localhost

Generating RSA keys:

Key generation complete.
会在用户目录~/.ssh/产生两个文件,id_rsa,id_rsa.pub

二,把id_rsa.pub文件拷贝到test2主机的用户目录下
cat id_rsa.pub >~/.ssh/authorized_keys
就可以了

这样test1主机的用户就可以通过ssh而不用密码登陆test2主机
阅读(2122) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~