Recommended Free Tools
A VPS is usually managed through an encrypted SSH session rather than a graphical desktop. The safest beginner workflow is: connect with a non-root account, verify exactly which machine and directory you reached, inspect before changing anything, use sudo only for the command that needs it, and keep a provider console or recovery path available before touching SSH, firewall, package, or storage settings.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
What you are actually managing
A virtual private server is a remote Linux computer. Your terminal sends commands over SSH (Secure Shell), and the server returns text output. OpenSSH supplies the server daemon and client tools, replacing older clear-text tools such as telnet and rcp, according to Canonical’s Ubuntu documentation.
| # | Preview | Product | Price | |
|---|---|---|---|---|
| 1 |
|
The Linux Command Line, 3rd Edition: A Complete Introduction | $27.94 | Buy on Amazon |
| 2 |
|
Linux Encryption Command Line T-Shirt, Men, Black, Small | $16.99 | Buy on Amazon |
As an Amazon Associate I earn from qualifying purchases.
Three terms prevent many mistakes:
- Process: a running instance of a program, such as a web server worker.
- Service: a program managed as a unit by an init system such as systemd; it can be started, stopped, enabled at boot, and inspected.
- Log: a record of events produced by a service, kernel, or application.
Commands vary with the distribution, shell, image, and installed packages. The examples below are primarily Ubuntu/Debian-oriented; verify your image before using package or service commands.
Connect over SSH and establish context
Make the first connection
- Obtain the server’s IP address, initial username, and SSH port from your VPS provider.
- From a local terminal, connect with
ssh user@server-ip. If your provider uses a non-standard port, add-p PORT; a configured host alias can replace the address. - Accept the host-key prompt only when the fingerprint matches the value supplied by your provider or a trusted administrator.
- Authenticate with your key or password. Never paste a private key into the server.
Run an identity and capacity check
Immediately after login, run:
whoami
hostname
pwd
uname -a
df -h
whoami shows the effective username, hostname identifies the machine, pwd shows your current directory, uname -a reports kernel and architecture details, and df -h displays filesystem space in human-readable units. Confirm these values before running a command copied from a guide.
#1 Best Overall
Also record the distribution:
cat /etc/os-release
Do not assume that an Ubuntu command applies to a Fedora, Rocky, Alma, or other image. Package names, service names, firewall tools, and configuration paths can differ.
Essential shell navigation and file commands
Understand paths
- An absolute path starts at the root directory, such as
/etc/ssh/sshd_config. - A relative path starts from your current directory, such as
logs/app.log. $HOME(usually written~) is your user’s home directory./etccontains system configuration,/var/logcommonly contains logs, and/tmpis temporary space.- A leading dot marks a hidden file or directory, for example
~/.ssh.
Inspect before changing
pwd
ls -la
cd /path/to/directory
cd ..
less filename
ls -la includes hidden entries and detailed ownership and permission fields. less opens a file for scrolling without editing it; press q to quit. Quote a path containing spaces, for example cd "Project Files".
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Create, copy, move, and remove
mkdir -p ~/sites/example
touch ~/sites/example/notes.txt
cp source.txt ~/sites/example/
mv old-name.txt new-name.txt
rm ~/sites/example/notes.txt
The shell expands wildcards before a command runs: *.log can match many files, and ? matches one character. Inspect an expansion with printf '%sn' ./*.log before using it in a destructive command.
pwd and ls -la immediately before deleting. Quote unusual names. Never use rm -rf until you can explain the exact directory and wildcard expansion; recursive deletion does not provide an undo function.Search text and files
grep -R "pattern" /path/to/directory
find /var/log -type f -name "*.log"
man grep
history
grep -R searches recursively, while find selects files by location, type, and name. man opens the installed manual page; search inside it with /word. Shell history lets you review previous commands, but do not blindly re-run a line that contains an old path, wildcard, password, or destructive option.
Users, sudo, ownership, and permissions
Use a non-root account
Ubuntu installations normally disable direct administrative root login. An authorized user uses sudo to elevate one command, creating accountability in logs. Check your identity and privileges with:
id
groups
sudo -l
Use sudo only where required, such as sudo systemctl restart nginx or sudoedit /etc/ssh/sshd_config. A root shell makes every typo more consequential and removes the pause that a one-command elevation provides.
Read the permission display
ls -l /path/to/file
stat /path/to/file
An ls -l line begins with a file-type character followed by three permission triplets: owner, group, and everyone else. The letters mean read (r), write (w), and execute (x). For directories, execute means the ability to enter or traverse the directory.
| Command | Purpose | Example |
|---|---|---|
chmod |
Change permission bits | chmod u+x script.sh |
chown |
Change owner, optionally group | sudo chown appuser:appgroup file |
chgrp |
Change group only | sudo chgrp appgroup shared.log |
Choose the smallest owner, group, and mode that permits the required operation. chmod 777 grants read, write, and execute to everyone and is not a general fix. For SSH keys, only the account using them should be able to write the key file; Ubuntu documents chmod go-w .ssh/authorized_keys as a corrective example.
Update software without guessing the distribution
Ubuntu and Debian
After checking /etc/os-release, the usual sequence is:
sudo apt update
sudo apt upgrade
apt update refreshes package indexes; apt upgrade installs available upgrades. Read the proposed changes and make production updates during a planned window. A package update can require a service restart or a reboot, and it can expose a configuration incompatibility.
Fedora and Red Hat-family images
These distributions commonly use dnf, but repository configuration and package names still vary. Consult the documentation for the exact image rather than pasting an Ubuntu apt command into an unknown server.
Before any broad update, ensure you have a current backup and a provider console or recovery route. Keep a written note of what you changed and how to reverse it.
Rank #2
- Linux Encryption Tools design. Linux Encryption Command Line T-shirt. Linux funny T-shirt
- Linux Funny T-shirt, Linux humor T-shirt, Linux jokes T-shirt
- Lightweight, Classic fit, Double-needle sleeve and bottom hem
Inspect CPU, memory, storage, services, and logs
Find resource pressure
ps aux
top
free -h
df -h
du -sh /path/to/directory
ps aux gives a snapshot of processes. top provides a live view; htop is an optional, more interactive alternative when installed. free -h reports memory and swap, df -h reports filesystem capacity, and du -sh estimates the space used by a particular directory. A full filesystem can make an otherwise healthy service fail to write files, rotate logs, or start.
Inspect a managed service
sudo systemctl status SERVICE
sudo systemctl is-enabled SERVICE
sudo systemctl restart SERVICE
sudo journalctl -u SERVICE -b --no-pager
Replace SERVICE with the actual unit name. status shows state and recent messages; is-enabled tells you whether it is configured to start at boot; restart interrupts and starts it again; journalctl reads this boot’s logs. For live SSH troubleshooting, Ubuntu documents sudo journalctl -fu ssh.service. Read the log before repeatedly restarting: the first error often identifies a missing file, permission problem, port conflict, or invalid directive.
Diagnose networking from facts
Check addresses, routes, DNS, and listeners
ip addr
ip route
getent hosts example.com
ss -tulpn
ip addr lists interfaces and addresses; ip route shows the route, including the default gateway. getent hosts tests name resolution using the system’s configured resolver. Use a distribution-available DNS utility if you need additional record detail. ss -tulpn lists listening TCP and UDP sockets and, with appropriate privileges, the process owning each one.
Check the owning process before changing a firewall rule. A web service listening only on 127.0.0.1 is not reachable from the internet even if a firewall allows the port; a service bound to all interfaces may be exposed when you did not intend it.
Host firewall versus cloud security group
| Control | Scope | Typical failure mode |
|---|---|---|
| Host firewall | Rules enforced inside the VPS operating system | A rule or reload can block SSH or the application after the packet reaches the server |
| Cloud-provider security group | Provider network boundary before traffic reaches the VPS | Missing ingress or egress rule prevents traffic from arriving, even when the host is configured correctly |
Check both layers, and preserve the current SSH path until an alternate path has been tested. Ubuntu’s open-port guidance uses sudo ss -tulpn to identify the process listening on a port.
Restart a service or reboot?
| Action | Disruption | Diagnostic value |
|---|---|---|
| Service restart | Usually limits interruption to that service; active connections may drop | Tests the service and its configuration without resetting the whole operating system |
| Full reboot | All services and SSH sessions stop temporarily | Useful after a kernel or low-level change, but can hide the original failure and removes your current access during boot |
Change SSH safely and avoid lockout
Validate configuration before restarting
Ubuntu warns that a bad SSH directive can stop sshd and lock out the only remote administrator. Before editing /etc/ssh/sshd_config or an included snippet:
- Open a second SSH session and keep the first one active.
- Make a dated backup of the file or snippet.
- Edit with an administrative editor, for example
sudoedit /etc/ssh/sshd_config. - Validate syntax without restarting:
sudo sshd -t. - If validation succeeds, restart with
sudo systemctl restart ssh.service. - Test a new login from another terminal before closing the original session.
Know your provider’s web console or recovery environment before making the change. Do not disable password authentication until key login works and the recovery route has been verified.
Set up key authentication
ssh-keygen -t ed25519
ssh-copy-id user@server-ip
Protect the private key with a passphrase. The public key is copied to the account’s ~/.ssh/authorized_keys; the private key remains on your local computer. On the server, check ownership and permissions of ~/.ssh and authorized_keys. The authenticated user must be able to read the key file, and other users must not be able to write it.
Keep long-running work alive after disconnects
A dropped network connection can terminate a foreground command. Start maintenance inside a terminal multiplexer:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
tmux new -s maintenance
Run the task, then detach with the tmux detach key sequence shown by your client. After reconnecting, reattach with tmux attach -t maintenance. If tmux is unavailable, use screen instead. Ubuntu specifically recommends multiplexers because the process and its output remain available after an SSH disconnect.
A practical “site is down” sequence
- Confirm you are on the intended host with
whoami,hostname, anddf -h. - Check load, memory, and disk using
top,free -h, anddf -h. - Check the relevant service with
sudo systemctl status SERVICE. - Read its current-boot errors with
sudo journalctl -u SERVICE -b --no-pager. - Verify that the expected port is listening using
sudo ss -tulpn, and identify the owning process. - Check
ip routeand DNS resolution if the service depends on another hostname. - Compare host-firewall and provider security-group rules.
- Restart only the affected service after identifying a plausible cause; reboot only when the evidence or a planned kernel change requires it.
Rules that prevent expensive mistakes
- Inspect with
pwd,ls -la, and a read-only command before changing files. - Use a non-root account and elevate one command with
sudo. - Never treat
chmod 777as a troubleshooting shortcut. - Keep one working SSH session open while testing another.
- Validate
sshdwithsudo sshd -tbefore restarting it. - Use backups and a written change note before firewall, package, database, storage, or SSH work.
- Use
tmuxorscreenfor migrations, updates, and other long tasks.
Further study
For a structured treatment of the shell beyond this primer, William E. Shotts’s The Linux Command Line, 3rd Edition is positioned for beginner-to-intermediate readers and progresses from first terminal keystrokes through Bash programming. O’Reilly Learning lists 544 pages in 2026. Penguin Random House Retail lists a paperback publication date of February 17, 2026 and ISBN 9781718504523; availability and price vary by country and seller. The second edition was 504 pages, published March 7, 2019. The publisher reported more than 100,000 copies sold for the first edition in 2019, a figure that should not be generalized to later editions. The author’s site also provides a free digital edition alongside the printed book.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




