10 Lazy Linux Sysadmin Tricks to Supercharge Your Efficiency
This article presents ten practical Linux system‑administration tricks—from unmounting a stuck DVD drive and rescuing a frozen terminal to using screen collaboration, SSH backdoors, VNC tunnelling, bandwidth testing, and quick system‑info gathering—each designed to save time and boost productivity.
Efficient Linux system administrators can dramatically reduce routine work time with a handful of simple, often "lazy" tricks. Below are ten essential techniques covering device management, remote collaboration, password recovery, networking, and quick system diagnostics.
Trick 1: Unmount an Unresponsive DVD Drive
Identify the process holding the CD-ROM and force it to release the device before ejecting.
# mount /media/cdrom
# cd /media/cdrom
# while [ 1 ]; do echo "All your drives are belong to us!"; sleep 30; done
# fuser /media/cdrom
# fuser -k /media/cdrom
# ejectTrick 2: Recover a Frozen Screen
When the terminal becomes garbled, use the reset command instead of rebooting.
# cat /bin/cat
# resetTrick 3: Screen Collaboration
Share a terminal session with a colleague using screen so both can see and type commands simultaneously.
# su - david
# ssh posh
# screen -S foo
# screen -x foo # colleague joins
# Ctrl-A D # detach
# screen -x foo # re‑attachTrick 4: Recover a Forgotten Root Password
Boot into GRUB single‑user mode, edit the kernel line, append 1 to the parameters, and reset the password.
# passwd
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfullyTrick 5: Create an SSH Backdoor with Port‑Forwarding
Use -R to forward a remote port from an external machine to the internal server, then connect through it.
# ssh -R 2222:localhost:22 [email protected] # from internal host
# ssh [email protected] # from external host
# ssh -p 2222 root@localhost # access internal hostTrick 6: Remote VNC Over an SSH Tunnel
Start a VNC server on the internal machine and forward its port through the same SSH tunnel used in Trick 5.
# vncserver -geometry 1024x768 -depth 24 :99
# ssh -R 5999:localhost:5999 [email protected] # on internal host
# ssh -L 5999:localhost:5999 [email protected] # on external host
# vncviewer localhost:99Trick 7: Measure Network Bandwidth with iperf
Install and run iperf on both ends to benchmark the achievable throughput.
# wget http://dast.nlanr.net/Projects/Iperf2.0/iperf-2.0.2.tar.gz
# tar zxvf iperf-2.0.2.tar.gz
# cd iperf-2.0.2
# ./configure -prefix=/home/bob/perf
# make && make install
# /home/bob/perf/bin/iperf -s -f M # server side
# /home/bob/perf/bin/iperf -c ginger -P 4 -f M -w 256k -t 60 # client sideTrick 8: Handy One‑Liners for Hosts and Memory Checks
Generate a large /etc/hosts file automatically and verify memory size 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 -tm | grep Mem | awk '{print $2}'; done | sort | uniqTrick 9: Console Inspection via /dev/vcs
Read the virtual console buffer directly to see what a remote user typed.
# cat /dev/vcs1Trick 10: Quick System‑Info Collection
Gather CPU, disk, BIOS, and NIC details with a few commands.
# cat /proc/cpuinfo
# cat /proc/cpuinfo | grep processor | wc -l # CPU count
# df -h # disk usage
# dmidecode | less # BIOS info
# ethtool -i eth0 # NIC driver/firmwareBy mastering these command‑line tricks, Linux administrators can solve problems faster, reduce manual effort, and free up time for more enjoyable activities.
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.
