Skip to content

Restrict SSH Key to Specific Commands

View on Twitter

💡 You can restrict/force an SSH key to one command and prevent granting full access to a server.

👉🏼 Prepend the key in `authorized_keys` file with `command=""` (e.g.: `command="pm2 restart" ssh-rsa AAAAB3N...`).

Download the VPS Security Cheatsheet

Use this FREE security cheatsheet to not miss a step when securing your VPS.

A preview of the VPS Security Cheatsheet.

    You'll also get tips on building scalable Node.js applications about twice a month. I respect your email privacy. Unsubscribe any time.

    You might also like
    Companies That Provide Visa Sponsorship Read tip
    Add Public Key to Server With ssh-copy-id Read tip
    Check Worldwide DNS Propagation Read tip