SSH in five minutes
The minimum set of commands to work confidently in a server terminal: navigating files, editing configs, services, logs, and permissions.
Updated August 23, 2026
You don't need to know all of Linux to manage a machine. About fifteen commands are enough — they're below.
Where am I and what's around
pwd
ls -la
cd /etc/nginx
cat /etc/os-release
pwd — current directory, ls -la — contents with hidden files and permissions, cd — change directory. A path starting with / is counted from root; ~ is the home directory, for root it's /root.
Useful little things: Tab completes names, the up arrow brings up the previous command, Ctrl+C interrupts execution, Ctrl+D ends the session.
Files and directories
mkdir -p /opt/app/data
cp config.yml config.yml.bak
mv old.log /var/log/archive/
rm -f temp.txt
du -sh /var/log
rm -rfdoesn't ask and can't be undone. Before running it, read the path again — especially if it starts with/.
Editing configs
A simple editor is nano:
nano /etc/ssh/sshd_config
Save — Ctrl+O, then Enter. Exit — Ctrl+X. If nano isn't installed:
apt install -y nano
Before editing a production config, make a copy: cp file file.bak.
Services
systemctl status nginx
systemctl restart nginx
systemctl enable --now nginx
systemctl disable --now nginx
enable means "start at machine boot", --now means "and right now". A forgotten enable is the most common reason a service doesn't come up after a reboot.
Logs
journalctl -u nginx -n 50 --no-pager
journalctl -xe
tail -f /var/log/syslog
The first is the last 50 lines of a specific service, the second is recent system events, the third is a live stream of a file (exit with Ctrl+C). When something doesn't work, start here, not with a reboot.
Packages
On Debian and Ubuntu:
apt update && apt upgrade -y
apt install -y curl git ufw
On AlmaLinux and CentOS Stream — dnf instead of apt, covered in a separate article.
Permissions and owner
chown -R www-data:www-data /var/www/site
chmod 600 /root/.ssh/authorized_keys
chmod +x deploy.sh
The number is the permissions for the owner, group, and others: 6 — read and write, 4 — read only, 7 — plus execute. Keys and secrets need 600, otherwise SSH will refuse to use them.
Resources and processes
free -h
df -h
ps aux | grep node
kill -9 12345
For a visual picture, btop is convenient, but over a text console it will be cropped to 80×24 — run it in SSH or on the machine screen.
Common mistakes
- They edit a config without a copy and then don't remember what they changed.
- They restart a service without reading
journalctland fix things blindly. - They set
chmod 777on a site directory "to make it work" — that's a hole, not a solution. - They forget
systemctl enableand lose the service after a reboot.
Next: the ~/.ssh/config file will save you from long connection commands, and the glossary will explain the terms.