35.3. 创建 SSH 密钥
在 Business Central 中添加或注册 SSH 密钥前,您必须在您的系统中生成 SSH 密钥。
流程
- 在 系统上打开一个命令终端。
运行
ssh-keygen
命令创建 SSH 密钥,如下例所示,其中 <user_login&
gt; 是您的用户名:ssh-keygen -t rsa -b 4096 -C "<user_login>"
注意Business Central 密钥存储支持的 SSH 密钥格式是
ssh-rsa
、ssh-dss
、ecdsa-sha2-nistp256
、ecdsa-sha2-nistp384
和ecdsa-sha2-nistp521
。提示时,按 Enter 并接受默认密钥文件位置,如下例所示,其中 <
user_login&
gt; 是您的用户名: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