谷歌云手动添加RSA密钥对Set Up SSH Keys on Google Cloud VM

https://www.linkedin.com/pulse/simplify-cloud-security-how-set-up-ssh-keys-google-vm-sreerag-u

ssh-keygen -t rsa 

cat ~/.ssh/id_rsa.pub

# or use custom key name
ssh-keygen -t rsa -f ~/.ssh/my_gcp_vm_key
cat ~/.ssh/my_gcp_vm_key.pub

ssh -i /path/to/privatekey user_name@instance-ip

说明:

  • -f ~/.ssh/my_gcp_vm_key:自定义密钥文件名为 my_gcp_vm_key,会生成两个文件:
    • 私钥:~/.ssh/my_gcp_vm_key
    • 公钥:~/.ssh/my_gcp_vm_key.pub

如果不需要设置密码,可以直接按回车跳过提示。

将公钥添加到 Google Cloud VM 的元数据中(指定用户名)

  1. 打开 Google Cloud 控制台,进入 “Compute Engine” > “VM 实例”
  2. 点击左侧菜单中的 “元数据(Metadata)”
  3. “SSH 密钥” 标签页中点击 “编辑”
  4. 粘贴刚刚复制的公钥内容,并在公钥前添加你要用于登录的用户名

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇