4 ms·
Using "command=" in authorized_keys is one way. I've used this to restrict a certain ssh key pair to only using allowing a few simple commands via a wrapper-she
by stock_toaster 6y ago
Using "command=" in authorized_keys is one way. I've used this to restrict a certain ssh key pair to only using allowing a few simple commands via a wrapper-shell script.
A couple of succinct examples I found via a quick google:
https://www.virtono.com/community/tutorial-how-to/restrict-executable-ssh-commands-with-authorized-keys/ https://www.virtono.com/community/tutorial-how-to/restrict-e...
https://ctrlnotes.com/restrict-a-user-to-ssh-forced-command/# https://ctrlnotes.com/restrict-a-user-to-ssh-forced-command/...
You could also use Match in sshd_config and ForceCommand too.
- mindcrime 6y agoAwesome. That's good stuff. I had figured there was a way to do with sshd configuration, but my (admittedly limited) initial Googling had not turned up anything. The "command=" thing seems pretty cool, since you can have a separate command for each certificate. I can see how that would be really useful.