seabox ssh-exkeys
seabox ssh-exkeys¶
在指定host之间交换ssh公钥
- 语法
-
``` bash seabox ssh-exkeys [OPTIONS]
Options: -v : verbose mode -p password : the password used to connect to hosts -h host : the new host to connect to (multiple -h is okay) -f hostfile : a file listing all new hosts to connect to -e hostfile : a file listing all existing hosts for expansion -x hostfile : a file listing all new hosts for expansion –help : show this help, then exit ```
- 描述
-
在指定host之间交换ssh公钥
- 注意:如有注意事项,补充
- 选项
-
该命令支持选项说明如下:
- Options
-
命令支持的选项
-v
- 使用该选项时表示启用详细的内部日志
-p
- 使用该选项时表示指定连接host时使用的口令,后面跟口令
-h
- 使用该选项时表示指定要连接的host,后面跟host名称,多个host使用多个-h选项
-f
- 使用该选项时表示指定列出所有要连接的新host的文件,后面跟文件名称
-e
- 使用该选项时表示指定列出所有要扩充的已存在的host的文件,后面跟文件名称
-x
- 使用该选项时表示指定列出所有要扩充的新host的文件,后面跟文件名称
-h, --help
- 使用该选项时返回seabox ssh-exkeys命令的帮助信息
- 注解
-
如有具体的使用限制及注意事项,在这部分列出。
- 注意: seabox ssh-exkeys命令要求使用SeaboxMPP数据库集群安装用户seabox,或root用户,且需通过以下命令设置正确的环境变量:
source $SDHOME/seaboxmpp_path.sh
其中,$SDHOME为安装SeaboxMPP数据库服务的主目录。
- 示例
-
以下是
seabox ssh-exkeys --help
的执行结果:[seabox@mpp-test-1 bin]$ seabox ssh-exkeys --help exchange ssh public keys among friends. Usage: seabox ssh-exkeys [OPTIONS] Options: -v : verbose mode -p password : the password used to connect to hosts -h host : the new host to connect to (multiple -h is okay) -f hostfile : a file listing all new hosts to connect to -e hostfile : a file listing all existing hosts for expansion -x hostfile : a file listing all new hosts for expansion --help : show this help, then exit Each line in a hostfile is expected to contain a single host name. Blank lines and comment lines (beginning with #) are ignored. The name of the local host (as provided by hostname) is included automatically and need not be specified unless it is the only host to process. During cluster expansion, the local host is always considered an existing host and should not be specified in the "new host" list. Duplicate host names in either the new host list (-h, -f, -x options) or the existing host list (-e option) are ignored. The same host name cannot appear in the both the new and existing host lists. Host names including a user name or port (username@hostname:port) are not accepted.
以下命令可交换test-1和test-2的ssh公钥
mpp $ seabox ssh-exkeys -h test-1 -h test-2 [STEP 1 of 5] create local ID and authorize on local host ... /home/sy/.ssh/id_rsa file exists ... key generation skipped [STEP 2 of 5] keyscan all hosts and update known_hosts file [STEP 3 of 5] authorize current user on remote hosts [STEP 4 of 5] determine common authentication file content [STEP 5 of 5] copy authentication files to all remote hosts [INFO] completed successfully
- 相关命令
- 无