36.3. 创建 SSH 密钥
在 Business Central 中添加或注册 SSH 密钥前,您必须在系统上生成 SSH 密钥。
流程
- 在您的系统中打开命令终端。
运行
ssh-keygen
命令来创建 SSH 密钥,如下例所示,其中 <user_login>
; 是您的用户名:ssh-keygen -t rsa -b 4096 -C "<user_login>"
注意Business Central keystore 支持的 SSH 密钥格式为
ssh-rsa
,ssh-dss
,ecdsa-sha2-nistp256
,ecdsa-sha2-nistp384
, 和ecdsa-sha2-nistp521
。提示时,按 Enter 键并接受默认密钥文件位置,如下例所示,其中 <
user_login>
; 是您的用户名:Enter a file in which to save the key (/home/<user_login>/.ssh/id_rsa): [Press enter]
在命令提示符输入并确认密码短语:
Enter passphrase (empty for no passphrase): [Type a passphrase] Enter same passphrase again: [Type passphrase again]
启动
ssh-agent
:eval "$(ssh-agent -s)" Agent pid <any-number-here>
将新的 SSH 私钥添加到
ssh-agent
。如果您使用其他密钥名称,替换该代码中的id_rsa
:ssh-add ~/.ssh/id_rsa