git config --global user.name "woaigithub" git config --global user.email "[email protected]" //新建公鑰和私鑰 ssh-keygen -C "[email protected]" -t rsa //顯示公鑰內容,拷貝到github的settings的public key中 cat /home/andy/.ssh/id_rsa.pub //測試和github的聯通性 ssh -v [email protected] //在github新建repository,名稱是rubyforum //在本地執行 mkdir rubyforum cd rubyforum git init touch readme cat >> readme ruby forum //[ctrl+d]退出 git add readme git commit -m "first commit" git add remote origin https://github.com/woaigithub/rubyforum.git git push origin master
驗證ssh
指定key文件
用於單機多ssh用戶認證。
ssh -v [email protected] -i /root/.ssh/id_rsa_gitcafe
本文URL:http://www.bianceng.cn/OS/Linux/201410/45616.htm