27 Comments
- evillawngnome, on 07/03/2008, -0/+8THe problem with sudo is that the administrator privilege does not cross pipes. Consider the following command:
sudo echo "System maintenance today at 1500CDT" > /etc/motd
This would not work, because sudo does not follow through pipes. So it kind of ***** all over any powerful command line usage you might want to do.
HOWEVER, it is totally correct and appropriate to use sudo for normal maintenance tasks, such as restarting a service:
sudo /etc/init.d/httpd restart
All of that said, you should be using root's login shell (sudo su -) to make sure the environment is set up properly.
Lastly, computer security does not replace policy. When I become the root user at work, the first command i enter is #evillawngnome, showing that this is the point in the history file where MY work begins, and i always end with #endevillawngnome. Now you know exactly what commands i entered. - MikeSD34, on 07/03/2008, -1/+7We like old-digg style technical stories.
- karlw, on 07/03/2008, -4/+10I realize how much of a linux dork I am when all my recommended upcoming stories are just like this. The sad part is i'm digging them.
- webkami, on 07/03/2008, -0/+4What ads?
AdBlock FTW - sublimemm, on 07/03/2008, -0/+4and now you're* blocked
- rizla420, on 07/03/2008, -0/+2Actually for this setup, which i followed for my webserver that I migrated from a shared hosting provider to a VPS it was perfect. Being root for all those tasks saves you from having to "sudo" practically every config you have to do. Once the system is up, just use a user account to do stuff and "sudo" when you need to.
- gthrank, on 07/03/2008, -2/+3Geez the snorg T-shirt girls are hot (the ads on the right).
- brettalton, on 07/04/2008, -0/+1Why can't these people just write useful scripts instead of making me punch in 20 things?
I write
[ http://brettalton.com/source.php?file=copy_floppy. ... ]
useful scripts
[ http://ubuntuforums.org/showthread.php?t=788169 ]
all the time
[ http://ubuntuforums.org/showthread.php?t=639979 ]
with an installer
[ http://brettalton.com/source.php?file=secure_delet ... ].
It's not the easiest thing to do in the world, but if you're a Linux nerd trying to help others, take the extra 15 minutes and do it! - flxfxp, on 07/03/2008, -0/+1What are you basing that on?
- Zaggynl, on 07/03/2008, -0/+1Arguments? Links?
- leejarratt, on 07/04/2008, -0/+1You're also blocked. Your grammar is a disgrace.
- Acglaphotis, on 07/03/2008, -0/+1I don't see any difference in the outcome, all of them get you into a root shell. Explain, please.
- flatlinebb, on 07/03/2008, -0/+1*[citation needed]
- DickBreath, on 07/03/2008, -0/+1If I use "sudo bash", I get a root prompt, right in the directory I'm in, with my current environment variables.
If I use "sudo -i", I get a root prompt, and am in root's home directory (/root) with root's environment variables -- which might be more secure.
Also try this as one way to sudo echo.
sudo bash -c "echo 'Be advised: todays Halo tournament will delay responses on all tech support trouble tickets.' > /etc/motd" - WebDevEric, on 07/03/2008, -1/+1What a coincidence, I just followed this exact howto 2 days ago.
It works great for what I need. - NinjaAdmin, on 07/08/2008, -0/+0Late, I know... but you apparently didn't check out "sudo -s"
- Nicksname1, on 07/03/2008, -2/+1Thanks. Great post, also if anyone is a basic user and this just seems like mumbo jumbo to them. Checkout the tutorial that is also referenced in this virtual hosting article http://www.howtoforge.com/perfect-server-ubuntu8.0 ...
it has some real good screenshots and this falko guy really takes the time to go into detail and explain. - NinjaAdmin, on 07/03/2008, -2/+0sudo su - is just as dumb.
"sudo -s" or "sudo -i" please. - derekivey, on 07/03/2008, -4/+1ProFTPd is full of security holes. Use PureFTPd instead...
- NinjaAdmin, on 07/03/2008, -4/+0Do not trust tutorials that tell you to "sudo su".
wtf. - inactive, on 07/03/2008, -6/+1what the *****. everyone knows about this site anyways. they might as well change the site to www.howtoforgefornewbs.com
- mickstephenson, on 07/03/2008, -7/+1and now your blocked
- TheWindBlows, on 07/03/2008, -8/+18.04.1
- inactive, on 07/02/2008, -15/+4GREAT BARGAIN, WILL BUY FROM AGAIN, A+++
- leejarratt, on 07/01/2008, -17/+2It's quiet in here... can you hear the echo?



What is Digg?
The Digg Toolbar for Firefox lets you Digg, submit content, and keep track of Digg even when you're not on the Digg site. Download the official