30.3. 创建 SSH 密钥
在向 Business Central 中添加或注册 SSH 密钥前,您必须在您的系统上生成 SSH 密钥。
流程
- 在您的系统上打开终端。
运行
ssh-keygen命令来创建 SSH 密钥,如下例所示,其中 <user_login> 是您的用户名: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> 是您的用户名: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