• Hi Guest!
    If you appreciate British Car Forum and our 25 years of supporting British car enthusiasts with technical and anicdotal information, collected from our thousands of great members, please support us with a low-cost subscription. You can become a supporting member for less than the dues of most car clubs.

    There are some perks with a member upgrade!
    **Upgrade Now**
    (PS: Subscribers don't see this gawd-aweful banner
Tips
Tips

Linux query

waltesefalcon

Yoda
Platinum
Country flag
Offline
If you are the only user on a system running Linux why type 'sudo' into the command line instead of just whatever command you want? What's the point of running a command as a superuser if you are the superuser?
 
Walter,

Permissions don't change because you're the only user you've added to the system. There are many 'users' defined by the operating system. Look at the /etc/passwd file. Each line represents a user. By default you're a normal user, until you use the sudo command.
 
That extra step for the superuser password stops the system to wait for your manual input. Without that, malware could do a lot worse to your system.
 
The real reason is so you don't shoot yourself in the foot. You should never run as superuser except when absolutely necessary. As SU you have absolute power over the system, including the power to accidently erase it. In fact it is strongly advised to not even use the su command except in extreme situations. Before retiring, I did use superuser a few rare time supporting Unix customers. After several years on Linux exclusively now I never had the need. Sudo works just fine for everything I need to do.
 
The real reason is so you don't shoot yourself in the foot. You should never run as superuser except when absolutely necessary. As SU you have absolute power over the system, including the power to accidently erase it. In fact it is strongly advised to not even use the su command except in extreme situations. Before retiring, I did use superuser a few rare time supporting Unix customers. After several years on Linux exclusively now I never had the need. Sudo works just fine for everything I need to do.
That makes sense. I didn't know there was a different between SU and Sudo. I thought Sudo was having the system run as superuser.
 
Sudo just lets you run one command as SU so it can also be dangerous. In this case though you need to do one specific thing and are unlikely to do it by accident.
 
It is also a useful safety feature - even on Windows and Apple systems it is very advisable to not use the upper-privlige users for routine usage. I run everything with non-administrative users regardless of platform, and only use an elevated permission when needed. Its not a perfect analogy but the way I explain it to my people here at work is:

If you are working while using an administrative user, then anything you do also inherits that elevated permission. Which means that any web site you goto can effectively take administrative control of your machine. Using non-administrative users puts a bit of a safety on things, and if you get a prompt requesting admin access - the correct answer is pretty much always NO.

Its not perfect because there are ways around it, backdoors that can claim admin rights without asking, etc but it conveys the concept for people who aren't system admins. Using SUDO just executes the one command with unlimited permission, but always remember that anything else started by that command also has the unlimited permission as well so its important to understand what that command does before invoking it.
 
That last paragraph says a lot. Thanks.
 
Back
Top