简体   繁体   English

git clone(SSH)通过docker中的超级用户运行获得收益

[英]git clone (SSH) gets reaped by supervisord run in docker

I'm trying to create application for hosting remote git repositories. 我正在尝试创建用于托管远程git存储库的应用程序。 What I'm trying to do is to allow user clone the repository by SSH, I'm using supervisord to serve my application and sshd, but when I'm trying to clone repository I get: 我想做的是允许用户通过SSH克隆存储库,我使用supervisor服务于我的应用程序和sshd,但是当我尝试克隆存储库时,我得到了:

$ git clone git@address:/repositories/some-repo
Cloning into 'some-repo'...
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

and in supervisord log I can see: 在主管日志中,我可以看到:

[date] INFO reaped unknown pid [PID]

So in my opinion it's just supervisord who is killing all not known PIDs. 因此,在我看来,只是主管人员杀死了所有未知的PID。 I'm sure that I have set correct access rights to my repositories and my key is added to authorized_keys file. 我确定我已经对存储库设置了正确的访问权限,并且我的密钥已添加到authorized_keys文件中。 My current supervisord config is: 我当前的主管配置是:

[supervisord]
logfile = /tmp/supervisord.log
directory = /tmp
childlogdir = /tmp

[program:app-sshd]
command=/usr/sbin/sshd -D

[program:app-uwsgi]
command = /usr/local/bin/uwsgi --ini /my/path/uwsgi.ini
stopsignal=INT

[program:app-nginx]
command = /usr/sbin/nginx

Is there any way to allow git connections in supervisor or will I need to replace my docker container with virtual machine to proceed with this project? 有什么方法可以在主管中允许git连接,还是需要用虚拟机替换docker容器才能继续进行此项目?

The issue was that my user had shell set to /bin/false and then he got logged out just after login. 问题是我的用户的shell设置为/bin/false ,然后他在登录后立即注销。 Changing it to /bin/bash resolved the issue. 将其更改为/bin/bash可解决此问题。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM