gitlab修改默认端口号

来源:互联网 发布:excel表函数数据分类 编辑:程序博客网 时间:2024/06/01 10:46
问题:gitlab 拉取文件是报错:
ssh: connect to host xxx.xxxxxxxx.xxxxx port 22: Connection refused
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
问题分析:
报错显示gitlab服务器22号端口拒绝连接,而服务器ssh连接端口为xxxx,因此需要修改默认端口号
问题解决:
编辑用户家目录下.ssh/config 文件
[root@xxxx]# cat ~/.ssh/config
Host xxx.xxxxxxxx.xxxxx
HostName xxx.xxxxxxxx.xxxxx
Port xxxx