Linux on Machines You Don't Own
Detention charges are checked against the depot gate log, the record of when each truck arrived and left. Every night Harbourline's gate system writes that log to an SFTP server, and your pipeline reads it each morning. For two days no file has appeared, and detention checks have stalled. The server, sftp01, is a Linux machine in Harbourline's data centre. You have a login through their jump host, and on that machine you are a guest.
The rule
Look before you touch; change the least; write down everything.
- Look before you touch. Start with commands that only read: disk space, service status, logs, file listings. Most problems explain themselves if you look first.
- Change the least. Make the smallest change that fixes the problem, and get the owner's agreement before you make it. This is their production machine, not your laptop.
- Write down everything. Keep a log of every command you ran and why. Harbourline IT can then audit it, repeat it or undo it.
The everyday toolkit is small:
ssh -J you@jump.harbourline.internal you@sftp01 # log in via the jump host
df -h # how full is each disk?
ls -lt /data/exports | head # newest files first
systemctl status gatelog-export # did the export service run?
journalctl -u gatelog-export --since yesterday # its recent log linesPermissions matter on shared machines. ls -l shows each file's owner and who may read or write it. A file whose permissions read -rw------- and whose owner is gatelog can be read and written by that user alone. A pipeline running as any other user cannot open it.
The shortcut
Three looks before one change: space, service, logs. A failed job on a Linux server very often explains itself in one of those three places.
Space
df -hshows the/datadisk at 100% full. Two years of old export files were never cleaned up.
The trap is the fast fix: sudo rm -rf on a folder you believe is safe, or restarting services until something works. On someone else's server, one fast mistake can cost the whole engagement.
Drills
Answer fast — trust the rule.
Which command shows how full each disk is?
A nightly job has failed on a Harbourline server. What is your first move?
A file's permissions read -rw------- and its owner is gatelog. Your pipeline runs as the user loomwork. Why can't it read the file?
Which command lists a folder's files with the newest first?
Why keep a log of every command you run on a customer's server?
Remember
- Look before you touch; change the least; write down everything.
- Shortcut: three looks before one change: space, service, logs.
- Trap: fast, destructive fixes such as
rm -rfor blind restarts on someone else's server.
