# How do I work on production servers without the fear of one wrong command?

Valakes marks production servers in red, holds dangerous commands until you type the host name. Deletes and broadcasts ask again.

Source: https://valakes.com/use-cases/production-servers/

Last updated: 2026-11-25

Valakes marks a production host in red in six places and holds the commands that could hurt it until you confirm. It reads the line you typed, so it helps with slips. It does not replace a backup or a careful look.

You are on call and the server is live. Three terminals look alike and the prompt says the same thing on all of them. One command typed in the wrong window can cost a night.

Valakes cannot make a risky command safe. It makes sure you see where you are, and it makes you stop for a moment before a command that could do damage. The check is for your own mistakes: it reads the line you typed, and it is not a barrier against someone else.

## You always see which server is live

Choose an environment when you add a host. A production host gets a red stripe and a `PROD` badge on its tab, a thin red line along the top of the terminal, a red `prod` badge and focus ring on the composer, a red `PROD` segment in the status bar and a button that reads `Run on PROD`. Valakes suggests Production when the name or address contains `prod`, `production`, `live` or `prd`, and you confirm it.

The color comes from the host record you saved, never from anything the server prints, so a server cannot make a production tab look like a development one.

## A command that deletes files waits for you

Valakes reads a command before it runs. A dangerous one opens a risk card with the reason and, for deletes, a count of what would be affected. `Cancel` has the focus, so pressing Enter does not run the command. On a production host, `Run anyway` stays off until you type the host name, and a command rated Medium is raised to High. You can switch the card off for one host with `Don't ask on this host`, after a confirmation. See [the command check](https://valakes.com/features/command-check/).

The check reads the line you typed. It does not see inside a script, a remote alias or what a program does after it starts.

## Deleting in the file panel asks the same question

Delete in the Files panel always asks, with `Cancel` focused. On a production host, deleting a folder with content shows the number of files and their size, and you type the host name (while the command check is on for that host). Valakes refuses to delete `/` and your home folder on the server. See [Files](https://valakes.com/features/files/).

## A broadcast shows every host before it runs

When you send one command to several servers, a card lists each host with its environment and its risk. With one production host in the list you type its name, and with two or more you type their number. A High-risk command also needs a box ticked. See [broadcast and panes](https://valakes.com/features/panes-and-broadcast/).

## Guides

- [How do I stop a destructive command on a production server before it runs?](https://valakes.com/guides/stop-rm-rf-on-production/): Mark the host as Production once. Valakes then holds a dangerous command on a card until you type the host name.
- [How do I run the same command on several servers at once, safely?](https://valakes.com/guides/run-one-command-on-several-servers/): Open the servers as panes of one tab, start a broadcast in Commands mode and write the command once. Valakes rates it for every host and runs it only on the hosts you confirm.

## Read more

- [How do I use rm safely on a server?](https://valakes.com/learn/safe-rm-on-servers/): List what a command will remove before you run it, with ls, find or echo. Use rm -I so that rm asks once before a recursive delete, and write variables as "${dir:?}" so that an empty one stops the command. The built-in --preserve-root protects only the path /.
- [How do I run one command on many servers over SSH?](https://valakes.com/learn/run-command-on-many-servers/): Put the host names in a file and run ssh -n -o BatchMode=yes -o ConnectTimeout=5 host command for each one, in a loop for a few servers or with xargs -P for many. Keep each host's output and exit status, so one host that fails never hides behind the others.
- [How do I read logs on a Linux server?](https://valakes.com/learn/read-server-logs/): Use tail -f to watch a log file live, grep -C 3 to see a match with the lines around it, and zgrep for the rotated copies that are compressed. For a service that logs to systemd, run journalctl -u name --since "1 hour ago". You need sudo or the right group for the journal.
