2020年9月12日 星期六

[Git 常見問題] Specify SSH Port for Git

 Source From Here

Question
use a non-standard ssh port (1234) for most of the servers I connect to. So in my ssh config file I have:
But github.com uses port 22. When I try to connect to github it obviously tries to use port 1234. Right now I have to edit my ssh config to get things to work.

HowTo
Just have a look at how to set up your ~/.ssh/config file correctly (man 5 ssh_config). You can specify different settings for different hosts easily. To solve your problem you would set:
  1. Host github.com  
  2. Port 22  
  3. Host *  
  4. Port 1234  
Do have a look at the ssh_config manual page, it explains everything you need to know on the first few pages.

沒有留言:

張貼留言

[Git 常見問題] error: The following untracked working tree files would be overwritten by merge

  Source From  Here 方案1: // x -----删除忽略文件已经对 git 来说不识别的文件 // d -----删除未被添加到 git 的路径中的文件 // f -----强制运行 #   git clean -d -fx 方案2: 今天在服务器上  gi...