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
Secure Your VPS: Disable Password Login Read tip
What Makes a Website Static Read tip
HTTP Service Backend for Fast Prototyping Read tip