l         作者:赵**([email protected]***.cn)

ssh建立信任连接的方法

Linux端

以在10.1.56.225上建立与10.1.56.218连接为例

1.         10.1.56.225服务器上生成公钥

[zhaoli.***[email protected] ~]$ ssh-****** -t rsa

Generating public/private rsa key pair.

Enter file in which to save the key (/home/zhaoli.***.cn/.ssh/id_rsa): 回车

Created directory '/home/zhaoli.***.cn/.ssh'.

Enter passphrase (empty for no passphrase): 回车

Enter same passphrase again: 回车

Your identification has been saved in /home/zhaoli.***.cn/.ssh/id_rsa.

Your public key has been saved in /home/zhaoli.***.cn/.ssh/id_rsa.pub.

The key fingerprint is:

98:47:78:6c:de:07:63:fe:81:11:a1:42:82:33:7d:81 zhaoli.***[email protected]

2.         确认.ssh目录下是否已生成公钥文件id_rsa.pub

3.       重复上面步骤,在10.1.56.218服务器上生成公钥

4.         10.1.56.225公钥id_rsa.pub文件copy10.1.56.218服务器.ssh/authorized_keys文件中

[zhaoli.***[email protected] ~]$ cat .ssh/id_rsa.pub | ssh zhaoli.***[email protected] 'cat >> .ssh/authorized_keys'

zhaoli.***[email protected]'s password: 密码

5.         10.1.56.218服务器,修改authorized_keys文件的权限

[zhaoli.***[email protected] ~]$ chmod 700 .ssh/authorized_keys

6.         10.1.56.225服务器,执行如下命令,就可以在连接时不用输入密码了

[zhaoli.***[email protected] ~]$ ssh zhaoli.***[email protected]

Last login: Tue Sep 27 12:00:03 2011 from 192.168.104.74

[zhaoli.***[email protected] ~]$

 

Windows

以在10.1.56.225上建立与10.1.56.196连接为例

1、  10.1.56.225上生的公钥id_rsa.pubftp 上传至10.1.56.196

2、  远程桌面连接10.1.56.196,打开“WinSSHD Control Panel

配置管理小报110928-2:ssh建立信任连接的方法

3、  按下图红色部分逐步操作完成设置

配置管理小报110928-2:ssh建立信任连接的方法

4、在10.1.56.225服务器,执行如下命令,就可以在连接时不用输入密码了

[zhaoli.***[email protected] ~]$ ssh zhaoli.***[email protected]

Microsoft Windows [?[1;22H?[1;24H 5.2.3790]

(C) ?[2?[2;13H 1985-2003 Microsoft Corp.

 

C:Documents and Settingszhaoli.***.cn>

转载于:https://my.oschina.net/tadcat/blog/149810

相关文章:

  • 2021-09-19
  • 2021-12-09
  • 2021-10-24
  • 2022-12-23
  • 2022-02-05
  • 2021-10-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-30
  • 2022-03-03
  • 2021-12-07
  • 2021-06-12
  • 2021-06-03
  • 2021-07-30
相关资源
相似解决方案