假设SSH端口号将22改为2222
1 生成私钥
# ssh-keygen -t rsa -C “[email protected]”
密钥默认生成在/root/.ssh目录下
# cd /root/.ssh
# ls
id_rsa id_rsa.pub
2 配置gitlab
用户->设置->SSH密钥,复制id_rsa.pub里面内容到密钥中
3.客户端ssh克隆
# git clone ssh://[email protected]:2222/root/test.git