Article Number: 000025477
SSH 是一种网络协议,允许使用两个联网设备之间的安全通道交换数据。SSH 被设计为替代 Telnet 协议,因为 Telnet 无法保护数据免受“中间人”攻击。SSH 使用的加密在不安全的网络(如互联网)上提供数据的机密性和完整性。
出于方便、易于管理以及集成到其他产品(例如 DELL EMC DPA)的目的,可能需要以编程方式访问 DD,而无需管理员每次都提供密码,或者将密码不安全地存储在某个文本文件中。这就是 SSH 密钥身份验证的用武之地。
SSH 要求
服务器的主机密钥未缓存在注册表中。您无法保证服务器是您认为的计算机。服务器的 rsa2 密钥指纹为:ssh-rsa 1024 7b:e5:6f:a7:f4:f9:81:62:5c:e3:1f:bf:8b:57:6c:5a 如果您信任此主机,请单击 Yes以将密钥添加到 PuTTY 的高速缓存并继续连接。如果您只想继续连接一次,而不将密钥添加到缓存中,请点击“否”。如果您不信任此主机,请点击 取消 放弃连接。
单击 Yes
生成 SSH 密钥。
#### 建议的密钥类型为“rsa”,并且是唯一适用于 DDOS 6.0 及更高版本的密钥类型
# 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.
#### “dsa”类型的密钥也适用于 DDOS 5.7 或更低版本,但不再建议使用此密钥类型
# ssh-keygen -t dsa
Generating public/private dsa key pair. Enter file in which to save the key (/root/.ssh/id_dsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_dsa.
DDOS 命令参考中提到要使用” d
“选项而不是”-t dsa
."任一方法都适用于 DDOS,但是” d
“不适用于许多 Linux 发行版。
在运行脚本时,使用空白密码选项可绕过 Data Domain 系统密码要求。
记下新 SSH 密钥的位置”ssh-keygen
“命令输出。它作为名为 id_rsa.pub 的文件存储在 .ssh/ 下的用户$HOME目录下。
将生成的密钥添加到 Data Domain 系统访问列表。
# ssh -l sysadmin 168.192.2.3 "adminaccess add ssh-keys" < ~/.ssh/id_rsa.pub
The authenticity of host '168.192.2.3(168.291.2.3)' can't be established. RSA key fingerprint is f6:36:6e:32:e1:2d:d9:77:40:7e:0e:f8:5f:32:8d:0a. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '168.192.2.3' (RSA) to the list of known hosts. Data Domain OS 0.31.0.0-152384 Password: sysadmin_password
测试功能。
# ssh sysadmin@168.192.2.3 "df -h" Data Domain OS Resource Size GiB Used GiB Avail GiB Use% Cleanable GiB* ------------------ -------- -------- --------- ---- -------------- /backup: pre-comp - 50.0 - - - /backup: post-comp 4922.3 2.7 4919.7 0% 0.0 /ddvar 78.7 0.5 74.2 1% - ------------------ -------- -------- --------- ---- -------------- * Estimated based on last cleaning of 2010/02/02 06:00:59.
您还可以将文件中系统命令的整个脚本传递到设备。这是通过运行命令指向包含命令列表的特定文件来完成的:
# ssh sysadmin@DDR < FULL_LOCAL_PATH_TO_SCRIPT_TO_RUN_ON_REMOTE_DD
这允许操作员在远程主机上创建命令列表,然后通过 SSH 一次性运行所有这些命令。
将系统配置为不使用密码登录:Windows 系统 (PuTTY)
安装 SSH PuTTY 工具:Windows 系统上的 PuTTY、PuTTYgen 和 Pageant
创建 PuTTY 会话。
输入自动登录用户名。
创建 PuTTY 密钥。
在 Data Domain 系统命令行中添加密钥。
adminaccess add ssh-keys
将密钥连接到 PuTTY。
打开会话。
admin_name@company.com Last login: Thu Feb 4 10:51:10 EST 2010 from 168.192.2.3 on pts/2 Last login: Thu Feb 4 18:56:14 2010 from 168.192.2.3 Welcome to Data Domain OS 0.31.0.0-152384 ----------------------------------------- #
Data Domain, DD120 Appliance, DD140 Appliance, DD410 Appliance, DD430 Appliance, DD460 Appliance, DD510 Appliance, DD530 Appliance, DD560 Appliance, DD565 Appliance
DD580 Appliance, DD610 Appliance, DD630 Appliance, DD660 Appliance, DD670 Appliance, DD690 Appliance, DD880 Appliance
02 Jul 2024
4
How To