Ssh tips and tricks, part 6

Time for the sixth parth of the ssh guide. This time I’ll dig a bit deeper into using a command in your authorized_keys file. That way you will be able to remotely run a command, about the same way you would like: ssh b10m.example.net uptime, which would return the uptime of the server. If you want to restrict the commands that can be used in the remote command, simply put them into the ~/.ssh/authorized_keys file:
command=”/usr/bin/uptime” ssh-dss AAAAB3NzaC1kc3M…[ rest of key ]…ED8s CommentIf you try to login to the other server now, you only get the output of uptime back:
$ ssh joffie@b10m.example.net
Preview: