logoalt Hacker News

0cf8612b2e1elast Sunday at 8:11 PM2 repliesview on HN

I suppose /usr/sbin/nologin is not a thing?

https://www.man7.org/linux/man-pages/man8/nologin.8.html


Replies

inigyoulast Sunday at 8:39 PM

That's a hack. It's a login shell that, once you have already logged in and run the shell, prints a message saying you can't log in or run a shell, and then exits.

It does not stop you from, say, logging in to SSH and then starting a port forward. Or running a command in a way that bypasses the login shell. ssh will always pass it to your login shell but other ways can be vulnerable.

show 1 reply
trucks-refinishlast Monday at 11:49 AM

git-shell is actually made for this exact situation. it does allow uploading git repos I think so you can't open it to the public, maybe there's a way to configure it though to not allow that.