Other Handy Tools
SSH can help secure a truly staggering variety of administrative
tasks. I’d be remiss, however, not to mention two
other tools useful for this purpose. These tools,
su
and
sudo
,
can help minimize the time you spend logged on as or operating with
root privileges.
What’s Wrong with Being root?
Many new Linux users, possibly because they often run single-user
systems, fall into the habit of frequently logging in as
root. But it’s bad practice to
log in as root in any context other than direct console access (and
even then it’s a bad habit to get into, since it
will be harder to resist in other contexts). There are several
reasons why this is so:
- Eavesdroppers
Although the whole point of SSH is to make eavesdropping unfeasible, if not impossible, there have been a couple of nearly feasible man-in-the-middle attacks over the years. Never assume you’re invincible: if some day someone finds some subtle flaw in the SSH protocol or software you’re using and successfully reconstructs one of your sessions, you’ll feel pretty stupid if in that session you logged in as root and unknowingly exposing your superuser password, simply in order to do something trivial like browsing apache logs.
- Operator error
In the hyperabbreviated world of Unix, typing errors can be deadly. The less time you spend logged in as root, the less likely you’ll accidentally erase an entire volume by typing one too many forward slashes in an
rmcommand.- Local attackers
This book is about bastion hosts, which ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access