小编Cod*_*rer的帖子

当我从命令行生成 SSH 公钥时,为什么我的主机名会附加到它?

当我在 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)

ssh bash ubuntu ssh-keys

4
推荐指数
1
解决办法
7553
查看次数

标签 统计

bash ×1

ssh ×1

ssh-keys ×1

ubuntu ×1