10 Lazy Sysadmin Tricks to Boost Linux Efficiency in Minutes
This article presents ten practical Linux system‑administration tricks—from unmounting a stuck DVD and recovering a frozen screen to using SSH tunnels for VNC, resetting root passwords, measuring bandwidth with iperf, and gathering system information—each designed to save time and improve efficiency for busy administrators.
A skilled Linux system administrator can accomplish in ten minutes what others might need two hours for, and this guide shares ten essential, "lazy" tricks to boost efficiency.
1. Unmount an unresponsive DVD drive
Mount the DVD, start a dummy loop, then try to eject. When the device is busy, use fuser to find the owning process and kill it.
# mount /media/cdrom<br># cd /media/cdrom<br># while [ 1 ]; do echo "All your drives are belong to us!"; sleep 30; done # eject # fuser /media/cdrom # fuser -k /media/cdrom # eject2. Recover a stuck screen
When the terminal becomes garbled, use reset (not reboot) to restore normal output.
# cat /bin/cat # reset3. Screen collaboration
Share a terminal session with a colleague using screen. Create a session, attach to it, and detach with Ctrl‑A D.
# su - david # ssh posh # screen -S foo # screen -x fooDetach: Ctrl‑A D. Re‑attach later with screen -x foo.
4. Recover a forgotten root password
Reboot, edit the GRUB entry, append 1 to the kernel line, boot into single‑user mode, and run passwd to set a new root password.
# passwd5. Create an SSH backdoor
Establish a reverse SSH tunnel through a publicly reachable host (blackbox.example.com) so that an external support machine can reach an internal server.
Verify policy and obtain permission.
On the internal server (ginger) run: # ssh -R 2222:localhost:22 [email protected] Keep the session open, then on the support machine connect: # ssh [email protected] From the support machine, reach the internal server: # ssh -p 2222 root@localhost Enter the internal root password when prompted.
Both parties can now work together, optionally using screen for shared sessions.
6. Remote VNC via SSH tunnel
Start a VNC server on the internal host, forward the VNC port through the same reverse tunnel, then forward it back to the support machine.
# vncserver -geometry 1024x768 -depth 24 :99 # ssh -R 5999:localhost:5999 [email protected] # ssh -L 5999:localhost:5999 [email protected] # vncviewer localhost:99Windows users can achieve the same with PuTTY; see the screenshot.
7. Check network bandwidth
Compile and run iperf on both ends to measure throughput.
# wget http://dast.nlanr.net/Projects/Iperf2.0/iperf-2.0.2.tar.gz<br># tar zxvf iperf*gz<br># cd iperf-2.0.2<br># ./configure -prefix=/home/bob/perf<br># make<br># make install # /home/bob/perf/bin/iperf -s -f M # /home/bob/perf/bin/iperf -c ginger -P 4 -f M -w 256k -t 608. Command‑line scripts and utilities
Use loops, awk, grep, and sed to automate tasks such as generating a large /etc/hosts file or checking memory across many nodes.
# P=1; for i in $(seq -w 200); do echo "192.168.99.$P n$i"; P=$(expr $P + 1); done >>/etc/hosts # for num in $(seq -w 200); do ssh n$num free -m | grep Mem | awk '{print $2}'; done | sort | uniq9. Console inspection
Read the virtual console devices to see what is displayed on a remote machine’s console.
# cat /dev/vcs110. Random system information collection
Gather CPU, disk, BIOS, and NIC firmware details using standard commands.
# cat /proc/cpuinfo # cat /proc/cpuinfo | grep processor | wc -l # df -h # dmidecode | less # ethtool -i eth0By sharing screens, reading manual pages, and constantly solving problems, administrators can become faster, more reliable, and free up time for other interests.
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.
