Categories
Linux Mastering Development

After Match Group block, in ForceCommand can I somehow refer to the username (etc.) in a generic fashion?

Suppose I am using Match Group and inside of that block I am using ForceCommand is there a way to refer to the name of the connecting user or the user’s home folder in a similar fashion AuthorizedKeysFile can use the tokens %h, %U, and %u?

Alternatively does ForceCommand get the contents of these tokens in some other form? That is, if I use /etc/ssh/sshrc to output environment variables I get to see $USER, $HOME et cetera; is it appropriate/allowed to use those inside ForceCommand?

In case it matters: I am using version 8.2p1.

Leave a Reply

Your email address will not be published. Required fields are marked *