本文共 466 字,大约阅读时间需要 1 分钟。
针对公网上的服务器的检查,在日志中会发现大量针对22端口(ssh)的非法扫描。为了增强安全性,减少这些扫描,我们将服务器的ssh端口改成了一个非标准的端口。
这时,连接github时,会出现错误,无法连接:
#git pull
ssh: connect to host github.com port xxxxx: Connection refused fatal: The remote end hung up unexpectedly解决方法,编辑一个 ssh 的config文件:
$vim ~/.ssh/configHost github.comHostName github.comPort 22
测试一下:
$ssh -T git@github.comHi pubyun! You've successfully authenticated, but GitHub does not provide shell access.$git pullCurrent branch master is up to date.
转载地址:http://fpoji.baihongyu.com/