The authorized_keys has a command="…" option that restricts a key to a single command. Is there a way to restrict a key to multiple commands? E.g. by having a regex there, or by editing some other configuration file?
SSH Authorized Keys – How to Use Command Option for Multiple Commands
commandssh
Related Topic
- Can Malicious User Bypass SSH Authorized_Keys Forced Command?
- Linux – pipe multiple files, single ssh connection, remote commands
- SSH Keys – Add Correct Host Key in Known Hosts for Multiple SSH Host Keys
- Linux – Using command in ssh authorized_keys breaks scp
- Linux – SSH: one authorized_keys for multiple service accounts
- Ssh – How safe is it to protect an ssh key without passphrase using the “command” option in the authorized_keys file
- Linux – ssh command to add a public key to the local `authorized_keys`
Best Answer
No. It is not "allowed" command, but "forced" command (as ForceCommand option).
The only possibility is to use different keys for different commands or read parameters from
stdin
.