gitlab git clone 提示我输入密码,我第一不知道这个密码啊。如何解决

我网上看

git clone git@192.168.1.235:operation/ihaozhuo.git
Cloning into 'ihaozhuo'...
git@192.168.1.235's password:
Permission denied, please try again.
git@192.168.1.235's password:
Permission denied, please try again.
git@192.168.1.235's password:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
输入密码 提示密码错误。

我ssh -vvv git@192.168.1.235
就报这个

然后我登陆到gitlab服务器修改了git 密码,就报没有权限访问。
是什么原因。我已经把本地的key 拷贝到gitlab 自己的ssh-key 上面了。

debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
git@192.168.1.235's password:
debug2: we sent a password packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
git@192.168.1.235's password:
debug2: we sent a password packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
git@192.168.1.235's password:

哪位好心人帮帮忙,我看下/etc/password

git:x:497:497:GitLab:/home/git/:/bin/bash

然后修改了

git:x:497:497:GitLab:/home/git/:/bin/git-shell

也不行,需要重启gitlab吗?

可是我重启了也不行啊

阅读 48.1k
6 个回答
cat >> .ssh/config <<eof
Host 192.168.1.235                                                              
    IdentityFile <KEY FILE>
eof
新手上路,请多包涵

git@192.168.1.235:operation/ihaozhuo.git
服务端设置下git密码: passwd git, 使用设置的密码

新手上路,请多包涵

怎么解决的,楼主

可能是SELINUX问题,在服务器执行以下命令:

setenforce 0

docker exec -it containerName bash 进入容器

修改gitlab.rb文件

// 在gitlab创建项目时候http地址的host
external_url 'http://xx.xx.xx.xx'

// 在gitlab创建项目时候ssh地址的host
gitlab_rails['gitlab_ssh_host'] = 'xx.xx.xx.xx'

# 22端口映射下
gitlab_rails['gitlab_shell_ssh_port'] = 8022

然后执行

sudo gitlab-ctl reconfigure
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进