- Community Home
- >
- HPE Community, China
- >
- 服务器
- >
- Unix工作站
- >
- HPUX主机间 建立SSH信任关系
Unix工作站
1753518
成员
4934
在线
108795
解答
论坛
类别
Company
Local Language
返回
论坛
讨论平台
返回
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
博客
信息
社区语言
语言
论坛
博客
- 将帖子标记为未读
- 加注书签
- 订阅
- 禁止
- 订阅此主题的 RSS 提要
- 高亮显示此帖
- 打印此帖
- 报告不当内容
修改时间 11-06-2015 05:39 PM
修改时间 11-06-2015 05:39 PM
HPUX主机间 建立SSH信任关系
分别在两台主机(guangxlp、guangxcw)上进行以下标红的操作::(以主机1 guangxlp的操作为例)
guangxlp#[/home]useradd -m zw
guangxlp#[/home]passwd zw
Changing password for zw
New password:
Re-enter new password:
Passwd successfully changed
guangxlp#[/home]su - zw <<====一定要先切换为信任用户
guangxlp#[/home/zw]/usr/bin/ssh-keygen -t rsa
Generating public/private rsa key pair.
Please be patient.... Key generation may take a few minutes
Enter file in which to save the key (/home/zw/.ssh/id_rsa): <<==一路回车
Created directory '/home/zw/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/zw/.ssh/id_rsa.
Your public key has been saved in /home/zw/.ssh/id_rsa.pub.
The key fingerprint is:
79:f1:f5:40:2a:dc:05:f9:d2:09:db:8a:6e:58:d6:8f zw@guangxlp
The key's randomart image is:
+--[ RSA 2048]----+
| .oo |
| . .o+ |
| + o*o. |
| . +o.=o |
| S .o.o .|
| .+ o |
| = o |
| . o E . |
| . |
+-----------------+
Generating public/private rsa key pair.
Please be patient.... Key generation may take a few minutes
Enter file in which to save the key (/home/zw/.ssh/id_rsa): <<==一路回车
Created directory '/home/zw/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/zw/.ssh/id_rsa.
Your public key has been saved in /home/zw/.ssh/id_rsa.pub.
The key fingerprint is:
79:f1:f5:40:2a:dc:05:f9:d2:09:db:8a:6e:58:d6:8f zw@guangxlp
The key's randomart image is:
+--[ RSA 2048]----+
| .oo |
| . .o+ |
| + o*o. |
| . +o.=o |
| S .o.o .|
| .+ o |
| = o |
| . o E . |
| . |
+-----------------+
guangxlp#[/home/zw]ll -a
total 112
drwxr-xr-x 3 zw users 8192 Nov 6 17:05 .
drwxr-xr-x 93 root root 8192 Nov 6 17:04 ..
-r--r--r-- 1 zw users 832 Nov 6 17:04 .cshrc
-r--r--r-- 1 zw users 347 Nov 6 17:04 .exrc
-r--r--r-- 1 zw users 334 Nov 6 17:04 .login
-r--r--r-- 1 zw users 700 Nov 6 17:04 .profile
-rw------- 1 zw users 38 Nov 6 17:05 .sh_history
drwx------ 2 zw users 96 Nov 6 17:05 .ssh
guangxlp#[/home/zw]cd .ssh
guangxlp#[/home/zw/.ssh]ll
total 32
-rw------- 1 zw users 1679 Nov 6 17:05 id_rsa
-rw-r--r-- 1 zw users 393 Nov 6 17:05 id_rsa.pub
guangxlp#[/home/zw/.ssh]cat /home/zw/.ssh/id_rsa.pub | ssh zw@guangxcw 'cat - >> /home/zw/.ssh/authorized_keys' <<==拷贝密钥文件到对端
The authenticity of host 'guangxcw (10.11.0.65)' can't be established.
ECDSA key fingerprint is 28:62:3a:15:f4:b6:56:82:98:6b:41:55:41:e7:b4:fd.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'guangxcw,10.11.0.65' (ECDSA) to the list of known hosts.
Password: <<===这里输入用户的密码
guangxlp#[/home/zw/.ssh]ssh guangxcw <<===此时ssh到guangxcw已经不需要密码了
guangxcw#[/home/zw]
total 112
drwxr-xr-x 3 zw users 8192 Nov 6 17:05 .
drwxr-xr-x 93 root root 8192 Nov 6 17:04 ..
-r--r--r-- 1 zw users 832 Nov 6 17:04 .cshrc
-r--r--r-- 1 zw users 347 Nov 6 17:04 .exrc
-r--r--r-- 1 zw users 334 Nov 6 17:04 .login
-r--r--r-- 1 zw users 700 Nov 6 17:04 .profile
-rw------- 1 zw users 38 Nov 6 17:05 .sh_history
drwx------ 2 zw users 96 Nov 6 17:05 .ssh
guangxlp#[/home/zw]cd .ssh
guangxlp#[/home/zw/.ssh]ll
total 32
-rw------- 1 zw users 1679 Nov 6 17:05 id_rsa
-rw-r--r-- 1 zw users 393 Nov 6 17:05 id_rsa.pub
guangxlp#[/home/zw/.ssh]cat /home/zw/.ssh/id_rsa.pub | ssh zw@guangxcw 'cat - >> /home/zw/.ssh/authorized_keys' <<==拷贝密钥文件到对端
The authenticity of host 'guangxcw (10.11.0.65)' can't be established.
ECDSA key fingerprint is 28:62:3a:15:f4:b6:56:82:98:6b:41:55:41:e7:b4:fd.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'guangxcw,10.11.0.65' (ECDSA) to the list of known hosts.
Password: <<===这里输入用户的密码
guangxlp#[/home/zw/.ssh]ssh guangxcw <<===此时ssh到guangxcw已经不需要密码了
guangxcw#[/home/zw]
以上表述为作者个人观点,不代表惠普公司,使用本网站,请遵守网站使用规则和条款
© 版权所有 2024 慧与发展有限责任合伙企业