Tuesday, May 24, 2016

ssh: connect to host IP port 22: Connection refused

一般我们自己买的VPS, 会把端口22 给禁掉,因为他特别容易受到攻击!

但是,我们在用git clone 代码的时候,会出现这种问题

╰─$ git clone hades@IP:/home/hades/kernelCode.git        128 ↵
Cloning into 'kernelCode'...
ssh: connect to host IP port 22: Connection refused
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


ssh  默认访问 22 端口

所以我们git  clone  set port 

you can do it like this:

git clone ssh://git@IP:port/home/hades/kernelCode.git


Thanks To:







No comments:

Post a Comment