Vous pourriez utiliser un ForceCommand
ainsi que Match
:
Match Address 10.1.0.0/16
ForceCommand /usr/bin/git-shell
De man sshd_config
:
Match Introduces a conditional block. ...
The arguments to Match are one or more criteria-pattern pairs or
the single token All which matches all criteria. The available
criteria are User, Group, Host, LocalAddress, LocalPort, and
Address.
ForceCommand
Forces the execution of the command specified by ForceCommand,
ignoring any command supplied by the client and ~/.ssh/rc if
present. The command is invoked by using the user's login shell
with the -c option.
Ainsi, la commande que vous spécifiez serait exécutée à l'aide du login de l'utilisateur Shell, qui doit accepter l'attribut -c
option. La connexion est fermée lorsque la commande se termine, donc à toutes fins pratiques, cette commande est leur Shell.