More sudo vs. su

You can 'get root' using sudo or by using su, however, be aware that they handle things a bit differently.

I've still been seeing some debate about which is better: the use of sudo, or simply using root or su.  They both have their place, actually, but the point here is that they work differently.

When you "sudo -s" to get a shell, your environment is inherited from your current user.  So, you'll notice, that when you sudo -s, and type cd ~, you don't go to root's home, but your current user.  Your $PATH stays the same, too.  Something like you'll see in figure 1:

Figure 1 - sudo in action

su -, on the other hand, gives you the environment of the user you're substituting - typically root.  Look at figure 2:

Figure 2 - su in action

Of course, there are ways to have sudo modify your environment, and there are switches that let su leave it alone.  I'm really talking about default cases here, which seem to be used most of the time.

I'm fine with a combination of sudo and su, depending on the environment.  On my local machine, I tend to su up to root and keep a root shell open somewhere - very old school, part of my preferences, and simply seared into my synapses.  However, sudo tackles a certain role that su does not: many admins, or demi-admins responsible for a given machine or network of machines.  Using sudo you are able to grant root (or other) privileges to specific users for specific commands.  However, more than just giving you root, commands are logged per user.  When a single admin user leaves, revoking that single account keeps you protected, rather than needing to change the root password everywhere (although, you most likely do want to change that, and other, passwords).

Of course, you still need to be very careful with the setup of sudo.  Many commands, seemingly innocent, will allow a user a 'trap-door' that still gives them full run of the system.

So, rather than debate su versus sudo, understand that they're complimentary, and have unique strengths and weaknesses.  Use them in the appropriate situation and neither will let you down.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I’ve gotten that out of

I’ve gotten that out of the way, here’s my real opinion of sudo: I think it’s a waste of time. The use of sudo from a security standpoint is stupid; if you’re really concerned about someone using the wrong commands while logged in as su, then that person really doesn’t deserve to be root. Just because you stick “sudo” Watch Anime Online in front of the command doesn’t mean it’s less likely Watch Anime Online for something stupid to happen. If the admin is going to make a mistake, it doesn’t matter what the hell that person uses.

They both have their place,

They both have their place, actually, but the point here is that they work differently. canada drugs

What a awesome 6 hour,

What a awesome 6 hour, thankyou to Dave and all the crew at Roudtuit Caravan park for all the work that went to running this event, well worth marking in the dairy for next year.
chat siteleri,chat siteleri, biber hapı, sohbet siteleri,sohbet siteleri ...
sesli sohbet, iyinet frmtr trkygnclr webmaster seo yarışması, kameralı sohbet, cinsel sohbet, adanalı, türk sohbet, oyun oyna ..
sohbet odaları, tabiii en önemliside iyinet frmtr trkygnclr webmaster seo yarışması 'dır, bize baya bi para getirecek.
sohbet
chat
chat odaları
porno izle
porno
sikiş
sikiş
porno izle
porno izle
porno

2010 new styles A-line

2010 new styles A-line Wedding Dresses,Beach Wedding Dresses,Evening Dresses,Prom Dresses on sale
evening dresses
Prom dresses
wedding dresses
on best wedding dresses for 2009 and 2010. You can find latest collection of woman's dresses and casual dresses on this site
discount Prom dresses
discount wedding dresses

I would like to say this

I would like to say this post is very beneficial for readers, thanks
Welder MIG

Hey, my husbandPosta ilan

Hey, my husbandPosta ilan wantes to fly an old plane, we live near knoxville but

I will have him where ever you are in March. I want it to be a suprise for his birthday. Please let me know before the end of

February where you will be and a price list. His birthday is the first week of March.
Gazete ilan