On your own laptop you have root, your tools and unlimited time. At a customer site you often get a jump host, a shared account, an unfamiliar distribution, no internet, a change window that closes in forty minutes and someone watching over your shoulder. This lesson adapts core Linux skills to that reality: orienting yourself on an unknown machine in two minutes, working without root, answering the classic "why is it broken?" questions from processes, disks, logs and the network, and leaving a clean trail so the customer trusts you with access next time.
- Orient yourself on an unfamiliar Linux host quickly and safely
- Diagnose CPU, memory, disk, process and service problems without root
- Read logs with journalctl and log files to find the first real error
- Test network paths from inside the customer's environment
- Work in a way that is recorded, reversible and respectful of the customer's systems
The first two minutes on a new machine
Before changing anything, find out where you are and what you are allowed to do. These commands are read-only and work as an ordinary user on almost every distribution.
whoami; id # your user and groups
hostname -f; uname -r # which machine, which kernel
cat /etc/os-release # distribution and version
uptime # load averages and time since boot
df -h; free -h # disk and memory at a glance
sudo -n -l 2>/dev/null || echo "no passwordless sudo"- Note the distribution family: package names, service names and log locations differ between Red Hat-style and Debian-style systems.
- Check
sudo -l(or ask): many customers grant narrow sudo rules, such as restarting one service, rather than full root. - Find the shared conventions: where applications live (
/opt,/srv), where logs go, which user the service runs as. - Start
scriptor a terminal recorder if the customer allows it, so you have a record of what you ran.
Processes, memory and disk
ps aux --sort=-%mem | head -15 # top memory consumers
ps aux --sort=-%cpu | head -15 # top CPU consumers
top -b -n 1 | head -20 # snapshot, works without an interactive terminal
du -xh --max-depth=1 /var 2>/dev/null | sort -h | tail
find /tmp -xdev -size +500M 2>/dev/nullFull disks cause a startling variety of symptoms: databases refusing writes, services that will not start, logins that hang. df -h shows space; df -i shows inodes, which can run out on systems with millions of tiny files even when space remains. A deleted file still held open by a process keeps its space until the process restarts; lsof +L1 lists those if lsof is installed.
Never delete files on a customer machine to free space without asking who owns them. Propose what to remove, get agreement, and prefer compressing or moving logs over deleting them.
Services and logs
Most long-running software on modern Linux is managed by systemd. You can usually read service state and logs without root, even if you cannot restart services.
systemctl status myapp --no-pager # state, PID, last log lines
systemctl list-units --failed --no-pager # anything that crashed
journalctl -u myapp --since "1 hour ago" --no-pager | tail -50
journalctl -p err -b --no-pager | tail -30 # errors since boot
tail -F /var/log/myapp/app.log # follow a file logFind the first error, not the loudest. A failed database connection at 09:02 explains the hundreds of request errors that follow it. Search with grep -n -i -m 20 'error\|exception\|denied\|refused' and then read the lines just before the first match. Permission problems often hide in the path: namei -l /path/to/file shows the owner and mode of every directory on the way, which is how you discover the parent directory nobody can enter.
Network checks from inside
The customer's network is the most common reason things work on your laptop and fail on their server. Test the exact path your software will use, from the machine it will run on.
getent hosts api.internal.example # name resolution via system resolver
nc -zv db.internal.example 5432 # is the TCP port reachable?
curl -sv https://api.internal.example/health -o /dev/null 2>&1 | grep -E 'Connected|SSL|HTTP/'
env | grep -i proxy # HTTP_PROXY / HTTPS_PROXY / NO_PROXY in effect
ss -tlnp 2>/dev/null | head # what is listening locallygetentuses the same resolver as applications;digandnslookupmay query different servers and mislead you.- If
ncconnects butcurlfails, the problem is above TCP: TLS, a proxy, or the application. - Corporate proxies are often required for outbound traffic and must be excluded for internal hosts with
NO_PROXY; the next lessons cover this in depth.
Working like a guest
- Read before you write. Gather evidence with read-only commands first and share what you found before proposing a change.
- Change one thing at a time, with a rollback ready: copy a config to
file.bak.YYYYMMDDbefore editing it. - Use the customer's change process. If changes need a ticket or a window, use it, even for small ones.
- Use tmux or screen on jump hosts so a dropped VPN does not kill a long-running command.
- Collect, do not exfiltrate. If you need logs off the machine, agree what may leave, redact secrets and personal data, and use the customer's approved transfer method.
- Leave it as you found it: remove temporary files and tools you installed, and write down what you changed.
End each access session with a three-line note to the customer: what you looked at, what you changed (or 'no changes'), and what happens next. It builds the trust that gets you access faster next time.