Open7
秘密鍵の登録
登録した秘密鍵の確認
ssh-add -l
登録した秘密鍵の削除
※ すべての秘密鍵が消える
ssh-add -D
Githubでssh使う時
~/.ssh/configに以下を記載
Host my-Host-Name # 任意のホスト名
HostName github.com
User git # github.comの場合のユーザーはgit
PreferredAuthentications publickey
IdentityFile /Users/name/.ssh/id_rsa
IdentitiesOnly yes
UseKeychain yes
AddKeysToAgent yes
ssh接続確認
ssh -T git@my-Host-Name
Hi my-user-name! You've successfully authenticated, but GitHub does not provide shell access.
ssh -T git@github.com
Hi my-user-name! You've successfully authenticated, but GitHub does not provide shell access.
git clone git@hostname:github-user-namme/repository-name.git
hostnameの部分は ~/.ssh/configのHostを指定する必要がある。