🤖
【ssh】よく忘れるssh鍵の作り方
ユーザーディレクトリ直下の.sshに移動
cd ~/.ssh
名前付きで鍵を作成
-
-tは鍵の種類(デフォルトはrsa) - GitHubはed25519推奨のよう
ssh-keygen -t rsa -f "id_rsa_{名前}"
同階層にconfigファイルを作成
下記はGithubの例
Host github github.com
HostName github.com
IdentityFile ~/.ssh/id_rsa_github
User git
エラーが出る場合はパーミションを変更
chmod 600 ~/.ssh/config
Discussion