ไฟล์ ~/.ssh/config เป็นไฟล์ที่เก็บ options ของ SSH Client โดยจะช่วยให้การ SSH ง่ายขึ้นแทนการใช้คำสั่งยาว ๆ เช่น แทนที่จะใช้ssh [email protected] -p 2222 -i ~/.ssh/id_rsa_dev
ก็ใช้ได้แค่ssh dev-server
ไฟล์ ~/.ssh/config ถูกสร้างขึ้นมา 2 วิธีหลัก ๆ คือ
- โดย Sourcetree
- โดยคำสั่ง
cd ~/.sshtouch confignano config
เนื้อหาในไฟล์จะเป็นประมาณ
JavaScript
# --- Specific Hosts --- # --- github.com ---
Host github.com AddKeysToAgent yes HostName github.com IdentityFile /Users/phunsanit/.ssh/phunsanit@GitHub PreferredAuthentications publickey UseKeychain yes User git # --- General / Defaults / Else ---
Host * AddKeysToAgent yes UseKeychain yes IdentityFile ~/.ssh/id_rsa