I'm getting annoyed by having to use sudo on my Ubuntu machine. The following are some of the reasons why:

I open some file owned by root, but I forget to open it with sudo. Now, I make a bunch of changes to the file, only to realize at the end when I try to save it that I can't. Now I have to re-open the file with sudo, and re-apply all my changes.

I want to move some files via nautilus, but I don't realize they're owned by root. An error dialog pops up, and again, I have to re-open nautilus with gksudo. This in general applies to all GUI applications.

Lets say I install MySQL, and I want to view some of its config files. Because of file permissions, I'm unable to view the files or sometimes even enter the directory, unless I become the MySQL user or root (doing something like "sudo cd [path]" doesn't work).

I want to change this situation so that its more like Windows XP (right now its like Windows Vista UAC crap), where I can basically do whatever I want with my machine. Yes, yes, I realize even on Windows XP there were certain important system files which you couldn't modify, but its still a hell of a lot better than the Ubuntu situation. And yes, I realize its more insecure, but I frankly don't care (I'm adult enough to take responsibility for my choices should s**t hit the proverbial fan).

Things I've already tried (or were suggested by other members):

Removing the sudo password: not bad, but I still have to remember to prefix commands with sudo

Making the time-out really long: same as above

Alias commands: now I don't have to remember to prefix sudo so often, but it'll get tiresome having to constantly alias new commands

Add myself to the appropriate groups - good idea, didn't think of it myself; however, it'll get tiresome having to contantly add myself to new groups

Ideas I have, but don't know if they will work or how to make them work:

Launch the original gnome-session with sudo (i.e., "sudo gnome-session"), and combine it with point #1 and #2 above. Since all other processes started will be child processes of the original gnome-session, this should take care of most problems.

Can someone help me?

[Update]
Adding aliases, although a bit tiresome, seems to be the most promising way. Unfortunately, the outstanding problems are:

File system operations: I don't want to always have sudo in front because if the file doesn't already exist, then it is created as being owned by root, which introduces big headaches. The only way I can think of (but it would be too dangerous) is to write a wrapper around filesystem commands to add sudo if it turns out that I'm modifying a root-owned file).

GUI apps: same as above.

A lot of people have voiced their disapproval at my request and down-voted my question, presumably because they think it's a horrible idea to decrease the "security" of the system. I would respectfully disagree, since I think that is a very narrow-minded view. Security measures don't exist in a vacuum - it must also be usable for it to be effective. If it becomes onerous and annoying, then people will do whatever they can to circumvent it.

I'm going the more tech-heavy route to get around it, but you see it when regular users choose short passwords, or write down their passwords when they are forced to choose ridiculously complex passwords. The consensus in the comments is that it's the user's fault or that the user should live with horribly-designed security measures, whereas I really feel that it is the designer's/programmer's fault. There should be a higher bar. What pisses me off the most is that the system could help you but doesn't. The OS/program obviously knows when I don't have permission to do something - why doesn't it just ASK ME to elevate my privilege level? Why does it make me REDO EVERYTHING, except this time use sudo?

To the people who say it prevents you from accidentally screwing up your sy

you can do what you want. you really really shouldn't. get used to working with sudo, and you'll start getting to know when to use it ahead of time... plus, you'll know when to use it on any other sudo-enabled system .
–
quack quixoteNov 11 '09 at 2:38

2

why not add yourself to the mysql group? should take care of #3.
–
DaveParilloNov 11 '09 at 2:42

2

That's stupid (the philosophy, not your answer) - the OS should adapt to me not the other way around.
–
red.octoberNov 11 '09 at 2:43

4

this reminds me of a HHGTTG quote: "This will all end in tears, I just know it." --marvin
–
quack quixoteNov 11 '09 at 2:49

1

@Nathaniel: I understand that, but in this case I'm willing to sacrifice the security aspect. @~quack: I don't really want to this to become a flame war - I'm just looking for help here. I've already stated what I need and that I'm aware of the consequences. I respect that you would do things differently. I'm only asking for the same respect in return.
–
red.octoberNov 11 '09 at 3:01

5 Answers
5

If you really want to 'be like Win XP', why not unlock the root account & do everything as root? Sudo is there to prevent you from trashing your system inadvertently. It is especially easy to screw up your X config as root. Backup often.

Yes, I've considered #2 and #3 (I'll edit the question to include things I thought about). What does #1 do - what new things can I do as part of the root group and the wheel group (what group is this - it sounds weird) that I couldn't do before?
–
red.octoberNov 11 '09 at 2:45

Ubuntu may be a bit different. There is no wheel group, although the default user is made a part of the admin group, which has the same entry as the root user in the sudoers file. I don't think adding myself to any group will allow to do things without prefixing the command with sudo.
–
red.octoberNov 12 '09 at 5:30

If a file allows edit or execute permission for a group & you are a member of the group, then you can edit or execute it, no sudo required.
–
DaveParilloNov 12 '09 at 15:52

You can install nautilus-gksu to add an "open as root" option in the right-click menu in the file browser. Combine that with removing the password for sudo and it's downright convenient to open something as root from the GUI. If you want to.

Also you can add a root terminal to your Applications menu. Right-click the applications menu and click Edit menus. Then go into System Tools and check off Root terminal. It's like sudo bash without any typing.

Thanks, but I just want to be able to do something, no questions or extra steps required.
–
red.octoberNov 11 '09 at 3:02

1

The root terminal has no extra steps, just a different icon to click. "Open as root" involves a right-click then a left-click instead of a double-click. Hell, once you've eliminated the password for sudo you can create a shortcut for gksudo nautilus and you can run the entire file browser as root. But the first bit of advice that leaps to mind is adapt or perish.
–
reganNov 11 '09 at 3:45

Running the entire file browser as root sounds like a good idea. And remember, "adapt or perish" does not explicitly state a subject. It applies to OS's as much as it does users.
–
red.octoberNov 11 '09 at 4:36

Work as root, problem solved. If you really value your convenience that highly above security...

It happens to me too that I want to edit a protected file and forget sudo. But my editors let me know before I can change anything, because they just don't let me (since the file is read-only. If I can even open it.) But then I exit, type ctrl-a, "sudo ", ENTER, and that's it (yes, I've upped the timeout quite a bit).

But... I really don't have to do anything root-y that often. Oh, and I don't use GNOME/KDE, so annoying popups don't happen. ;-)

Closing, let me quote the Eagles: "Get over it". Just get used to it. It will benefit you in the long run. Otherwise, you may, no, you probably will, get used to sloppy security. And that may hurt others too.