10 Essential Linux Sysadmin Hacks to Boost Efficiency
This article presents a collection of practical Linux system‑administration techniques—from unmounting a stuck DVD drive and resetting a frozen console to using screen sharing, SSH tunnels, VNC forwarding, bandwidth testing, and automated scripting—each designed to save time, improve troubleshooting speed, and increase overall operational productivity.
Tip 1: Unmount an Unresponsive DVD Drive
When a DVD drive cannot be ejected because a process is holding it, use # fuser /media/cdrom to identify the offending process and then # fuser -k /media/cdrom to terminate it, after which # eject will succeed.
Tip 2: Recover a Frozen Screen
If the terminal becomes garbled, simply run # reset; the screen will return to normal without rebooting the machine.
Tip 3: Screen Collaboration
Use GNU screen to share a session: on one host run # screen -S foo, then have the colleague attach with # screen -x foo. Both users can see each other's input, facilitating joint debugging. Detach with Ctrl‑A D and reattach later.
Tip 4: Recover a Lost Root Password
Reboot, interrupt the GRUB menu, edit the kernel line, append 1 to the parameters, and boot into single‑user mode. Then change the password with # passwd and reboot.
Tip 5: Create an SSH Backdoor
Establish a reverse SSH tunnel from an internal machine ( ginger) to an external host ( blackbox.example.com) using # ssh -R 2222:localhost:22 [email protected]. Remote support can then connect to the internal host via the tunnel.
Tip 6: Remote VNC Over SSH
Start a VNC server on the internal host ( # vncserver -geometry 1024x768 -depth 24 :99), forward the VNC port through the same reverse tunnel, and connect from the remote machine with # vncviewer localhost:99. Windows users can achieve the same using PuTTY port forwarding.
Tip 7: Bandwidth Testing
Install iperf on both ends, run # iperf -s -f M on the server and # iperf -c ginger -P 4 -f M -w 256k -t 60 on the client to measure throughput, noting typical 1 GbE results around 112 Mbit/s and higher when bonding NICs.
Tip 8: Command‑Line Scripting and Utilities
Generate bulk /etc/hosts entries with a loop, or query memory across many nodes using SSH and free, grep, and awk. These one‑liners reduce manual errors and speed up cluster administration.
Tip 9: Console Inspection
Read virtual console devices (e.g., # cat /dev/vcs1) to see what users typed on a remote system, useful when logs omit console output.
Tip 10: Random System Information Gathering
Collect CPU details with # cat /proc/cpuinfo, disk usage with # df -h, BIOS data with # dmidecode, and NIC firmware via # ethtool -i eth0. These commands provide quick diagnostics without rebooting.
Conclusion
Effective sysadmins continuously learn from peers, share screen sessions, read manual pages, and solve problems hands‑on; this habit yields faster, more reliable operations and frees up personal time.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
