简体   繁体   English

git clone通过ssh返回权限被拒绝(公钥,密码)

[英]git clone through ssh returns Permission denied (publickey,password)

I have production_server and git_repo_server, git_repo_server .ssh/authorized keys have production user id_rsa.pub. 我有production_server和git_repo_server,git_repo_server .ssh /授权密钥有生产用户id_rsa.pub。 When I ssh to production_server and make git clone - it works fine, don't ask any password. 当我SSH到production_server并进行git clone-可以正常工作时,不要询问任何密码。 When I try to clone git repo to production_server on my local mashine using ssh I see: 当我尝试使用ssh将git repo克隆到本地mashine上的production_server时,我看到:

Permission denied, please try again.
Permission denied (publickey,password).

It looks like ssh should be configured to send commands to remote server. 看起来ssh应该配置为向远程服务器发送命令。 But I don't know how to do it. 但是我不知道该怎么做。 Thanks for any help! 谢谢你的帮助!

Problem was fixed. 问题已解决。 I added 我加了

Host * 
    ForwardAgent yes

to /etc/ssh/ssh_config 到/ etc / ssh / ssh_config

See ssh-agent tutorial 请参阅ssh-agent教程

I had this issue the probelm was that the user/machine from which I'm accessing Gitosis was not registered as a user in the Gitosis project, and thus access was denied. 我遇到的问题是我正在访问Gitosis的用户/机器未在Gitosis项目中注册为用户,因此访问被拒绝。

  1. If you don't have one, generate SSH key in your machine "~/.ssh$ ssh-keygen -t rsa". 如果没有,请在计算机中生成SSH密钥“〜/ .ssh $ ssh-keygen -t rsa”。

  2. Use scp command to copy your public key (id_ras.pub) to gitosis_server, to gitosis_admin/keydir. 使用scp命令将您的公钥(id_ras.pub)复制到gitosis_server,复制到gitosis_admin / keydir。

  3. Make sure you rename id_rsa.pub to USER@SYSTEM.pub, USER = the client user, SYSTEM= the client system name. 确保将id_rsa.pub重命名为USER @ SYSTEM.pub,USER =客户端用户,SYSTEM =客户端系统名称。

  4. Follow instructions here to add the user (USER@SYSTEM) to the project [https://help.ubuntu.com/community/Git#Adding_users] 请按照此处的说明将用户(USER @ SYSTEM)添加到项目[https://help.ubuntu.com/community/Git#Adding_users]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 git clone heroku ssh权限被拒绝 - git clone heroku ssh permission denied Capistrano 在 git:check 上部署失败 - 权限被拒绝(公钥) - Capistrano Deploy Failing on git:check - Permission denied (publickey) git remote push:权限被拒绝(publickey,键盘交互) - git remote push : Permission denied (publickey,keyboard-interactive) 亚马逊EC2 + Capistrano + Git:权限被拒绝(publickey) - Amazon EC2 + Capistrano + Git: Permission denied (publickey) Capistrano bitbucket - 权限被拒绝(publickey) - Capistrano bitbucket - Permission denied (publickey) heroku - rails - 权限被拒绝(publickey) - heroku - rails - Permission denied (publickey) 如何理解为什么我一直得到:ssh-copy-id权限被拒绝(公钥)? - How to understand why I keep getting: ssh-copy-id Permission denied (publickey)? git@github.com:权限被拒绝(公钥)。 致命:无法从远程存储库读取。 在云上 9 - git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. on cloud 9 Heroku:权限被拒绝(公钥)。 致命的:执行git push时无法从远程存储库读取 - Heroku: Permission denied (publickey). fatal: Could not read from remote repository when doing git push 由于publickey推送到github时拒绝权限 - permission denied when pushing to github because of publickey
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM