rockstorm101 / git-server-docker

Git server over SSH
GNU General Public License v3.0
63 stars 14 forks source link

Problems using server #7

Closed xxlbug closed 1 year ago

xxlbug commented 1 year ago

Hello again ;-)

now my server is up an running and i can connect. BUT i can't clone any repos. In essence i think i overlooked something obvious with my tinkering and need some help please.

The current setup:

The service is up an running but a login with the git user gives me (ssh git@git-server -p 22):

fatal: could not open '/dev/null' for reading and writing: Permission denied
Connection to git-server closed.

In the enhanced logs/debug mode i get:

15/01/2023 21:43:42 Accepted publickey for git from 10.0.1.28 port 55336 ssh2: RSA SHA256:xxxx
15/01/2023 21:43:42 Received disconnect from 10.0.1.28 port 55336:11: disconnected by user
15/01/2023 21:43:42 Disconnected from user git 10.0.1.28 port 55336

I tried going directly into the docker shell and create a repo to clone it but get a similar error with git clone:

git clone ssh://git@10.0.2.28:22/xNotes.git
Cloning into 'xNotes'...
fatal: could not open '/dev/null' for reading and writing: Permission denied
fatal: Could not read from remote repository.

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

Not sure how to proceed, any logs i can provide i will.

Thank you kindly

rockstorm101 commented 1 year ago

Hi @xxlbug, thanks for reporting back. I've been able to reproduce this behavior. I suspect I missed the -H option on the script I provided on this answer. (Which again proves that fiddling with system users must be done very carefully) Please change it as follows and let us know if you can now log in and clone repositories.

- adduser -u 405 -G users -h /dev/null -g 'guest' -S guest
+ adduser -u 405 -G users -H -h /dev/null -g 'guest' -S guest
xxlbug commented 1 year ago

Thank you very much, now it works as intended :-)