当我在 Ubuntu 上通过 Bash 文件生成 SSH 密钥时,我的 PC 的计算机名称(我猜就是这样)会自动添加到该 SSH 密钥中。
这是在 bash 文件中生成密钥的部分:
# Create new ssh-key
echo | ssh-keygen -P ''
# Cat the ssh-key to print on the screen
cat ~/.ssh/id_rsa.pub
Output: ssh-rsa AAAAB....JpyT+gt pc172@pc172-centre-540S-03ILL
Run Code Online (Sandbox Code Playgroud)
为什么这部pc172@pc172-centre-540S-03ILL分会添加到生成的密钥中?
上面的部分类似于我的终端内路径之前显示的文本。
c172@pc172-centre-540S-03ILL:/var/www/new-project-ubuntu$
Run Code Online (Sandbox Code Playgroud)