当我尝试从本地推送到远程gitlab存储库时,权限被拒绝

a.t*_*aby 5 git gitlab

我在gitlab web ui中创建了一个存储库,并试图推送我的本地存储库.我使用以下命令添加了远程仓库:

$ git remote add origin test@x.x.x.x:project.git
Run Code Online (Sandbox Code Playgroud)

然后我试着推,但它错了.我不使用ssl.我想使用纯文本连接.

$ git push origin master
test@x.x.x.x's password:
Permission denied, please try again.
test@x.x.x.x's password:
Permission denied, please try again.
test@x.x.x.x's password:
Permission denied (publickey,password).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)

Von*_*onC 8

然后我从web ui创建了测试用户.并使用测试用户创建了项目.

您永远不会使用该用户在ssh中联系服务器:所有授权密钥都分组在一个帐户下,对于gitlab应该是git:~git/.ssh/authorized_keys

config/gitlab.yml.

所以尝试:

git remote set-url origin git@x.x.x.x:project.git
Run Code Online (Sandbox Code Playgroud)