秘密鍵の設定

$ vi ~/.ssh/config
Host github.com
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_rsa.github
    Port 22
$ ssh-add ~/.ssh/id_rsa.github
$ ssh-add ~/.ssh/id_rsa.github
Could not open a connection to your authentication agent.
$ eval `ssh-agent -s`
$ ssh-add ~/.ssh/id_rsa.github
Enter passphrase for /home/y.shimojo/.ssh/id_rsa.github:
Identity added: /home/y.shimojo/.ssh/id_rsa.github (/home/y.shimojo/.ssh/id_rsa.github)
# Start ssh-agent and add authentification keys
eval `ssh-agent -s`
# SSH key passphrase for Sakura
ssh-add /home/y.shimojo/.ssh/id_rsa.sakura
# SSH key passphrase for GitHub and Gitlab
expect -c "
set timeout 5
spawn ssh-add /home/y.shimojo/.ssh/id_rsa.github
expect \"Enter passphrase for .ssh/id_rsa.github:\"
send -- \"[passphrase]\n\"
"
$ ssh-add -l
$ ssh git@github.com
The authenticity of host 'github.com (192.30.252.129)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.252.129' (RSA) to the list of known hosts.
PTY allocation request failed on channel 0
Hi yujishimojo! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.

Git初期設定

$ git init
$ git add .
$ git commit -m "initial commit"
$ git remote add origin git@github.com:yujishimojo/[repo].git
$ git push -u origin master

トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS