# Gitlab SSH - 實驗室 gitlab https://gitlab.wmlab.csie.ncu.edu.tw/ ## 於本機端生成 ssh key 1. 生成 ssh key(本機端需安裝 git) `ssh-keygen -t rsa -C "[你的帳號email]"` 中間的選項基本上可以跳過,也可以自行設置(建議不要) 2. 複製生成的 key (如果有裝 xclip 可以自行複製) `cat ~/.ssh/id_rsa.pub` > 以上是顯示的指令,在自行右鍵複製 --- * 更多疑難雜症:https://docs.gitlab.com/ee/user/ssh.html ## 登入 ssh key 於 gitlab - 成功登入後,進入 Profile Settings ![image](https://hackmd.io/_uploads/ryUNezkv6.png) - 選擇 SSH Keys ![image](https://hackmd.io/_uploads/SJdueMkvp.png) - 進入後點擊右上角 Add SSH Key ![image](https://hackmd.io/_uploads/B1tTxGJDp.png) - 輸入你剛剛複製的 ssh key 內容到 key 中,如果格式正常,Title 應該會幫你自動填入 ![image](https://hackmd.io/_uploads/rJtl-z1wT.png) - 完成,可以進行 git clone 等操作 ### 檢查是否登入成功 - 輸入以下指令,連線成功應該會顯示 `Welcome to GitLab, [帳號名稱]!` `ssh -T git@gitlab.wmlab.csie.ncu.edu.tw`