This page looks best with JavaScript enabled

SSH 設定 authorized_keys 的步驟

SSH 設定 authorized_keys 的步驟

  1. 在 client 的 ~/.ssh 下指令: ssh-keygen ,會產生兩個檔案, private key id_rsa & public key id_rsa.pub
  2. 把 id_rsa.pub 的內容 append 到 server 的 ~/.ssh/authorized_keys 裡面即可

github 獨立出專用 key

cd ~/.ssh
ssh-keygen -f github_key
echo -e "\nHost github.com\n  Preferredauthentications publickey\n  IdentityFile ~/.ssh/github_key" >> config
chmod 600 config

GCP

cd ~/.ssh
ssh-keygen -t rsa -f gcp_key -C uSeRxXx
echo -e "\nHost gcp \n  HostName x.x.x.x \n  IdentitiesOnly yes \n  IdentityFile ~/.ssh/gcp_key \n  User uSeRxXx \n" >> config