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
Sites-Available vs Sites-Enabled in Nginx Read tip
Secure Your VPS: Use Non-Root User Read tip
A Better Minimum Compression Size in Nginx Read tip