4 ms·
> I eventually realised that typing sudo every time he touched a box was no defence against doing the wrong thing. IIRC, sudo logs all commands to syslog. Whi
by luser001 14y ago
> I eventually realised that typing sudo every time he touched a box was no defence against doing the wrong thing.
IIRC, sudo logs all commands to syslog. Which might come in handy. Yes, root commands will be logged by bash to .bash_history, but there are limits of # of commands lots, what happens if you are logged in multiple times into same account etc.
Anyway, that's why I like sudo.
- UnoriginalGuy 14y agoPlus security. With root login disabled a remote attacker won't have a known username to attack.
- wpietri 14y agoBeyond the logging, which I love, I use it for the differentiation of states. I'm just a little more attentive when I type "sudo" before something. At work, a relatively young engineer accidentally typed a command meant for a test database server into a production window. There was a big rush to restore from backups, and there was a small amount of data loss. One thing that came out of the retrospective, requested by the engineer in question, was the production hat. Before you opened up a connection to a production machine, you had to put on the large pirate hat. You could only put it back when you had closed the connections. I didn't really need it, but it was a great way for people to learn the necessary caution. It also ended up being a nice exclusive lock on futzing with production, and seeing it in use led to some good discussions that otherwise might not have happened. But the main thing was developing a strong differentiation of states in everybody's heads.
- darkarmani 14y agoAnother cheap solution is colorizing the prompt red for dangerous consoles and green for dev machines. This makes it very easy to notice when you selected the wrong terminal.
- Spoom 14y agoI use a different background color for the terminal in question; in this case, I use a dark red to signify a production system, and a dark blue to signify a development system. I find it quite useful. You can do this through Xterm profiles (Edit -> Profiles, Terminal -> Change Profile) in Linux and OS X, and I'm sure there's a way to do it in Windows / PuTTY.
- lifeisstillgood 14y agoI have tried the red / green console but never a pirate hat. My son now definitely thinks work is like his school :-)
- kisielk 14y agoI find most of the time I'm using sudo I don't want to type it before every command and so I use sudo -i which pretty much negates the benefit of logging anything other than to tell that I was sudo at some point.