One of our Git servers recently went down and we have no way to get it back up soon, so we've redirected the DNS to a dummy (placeholder) host, which when accessed via HTTP / HTTPS, sends users to our notice board with 302. I want to configure this server so any user with or without an SSH key can log in to the git
user, with commands limited to a preset one that writes a message (e.g. command="echo 'a message here'",restrict
).
I haven't figured out how to allow arbitrary login. (Restricting commands is easy) Any ideas? (OpenSSH 7.9p1, Debian Buster)
There is the option
ForceCommand
:There seems to be no single option matching
restrict
, but there are individual options to disable the features mentioned:It may be easier to create a file to use as the shell for the
git
user:As every command to be executed is passed to the user`s shell this limits the commands available to the client. It is possible to interpret the intended command by the client, but not necessary for your requirements.