UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Will their be any problems if I uninstall sudo? I'm not asking for the reasons why sudo is a great "security" feature, I just wanna know if it's gonna kill my system if i uninstall it.
Do not believe that you should uninstall sudo but you can disable it and then use root. It's listed some where (near the bottom I believe) of the guide regarding ubuntu.
Do not believe that you should uninstall sudo but you can disable it and then use root. It's listed some where (near the bottom I believe) of the guide regarding ubuntu.
You can setup your system so that it uses a proper root account instead of sudo but you cannot remove sudo completely without removing some other packages e.g. Ubuntu-base, gdm etc. The way I disable sudo, is to setup a password for root ($sudo passwd root) as a normal user (the one with sudo privileges). I then login as root in the command line and run visudo and comment out the section that enables users in the admin group to run all commands e.g.
Code:
# Members of the admin group may gain root privileges
#%admin ALL=(ALL) ALL
After that I remove the admin group and its entries from /etc/group. If you want to keep the admin group, just remove the normal user with sudo privileges from the admin group section in /etc/group.
You can setup your system so that it uses a proper root account instead of sudo but you cannot remove sudo completely without removing some other packages e.g. Ubuntu-base, gdm etc. The way I disable sudo, is to setup a password for root ($sudo passwd root) as a normal user (the one with sudo privileges). I then login as root in the command line and run visudo and comment out the section that enables users in the admin group to run all commands e.g.
Code:
# Members of the admin group may gain root privileges
#%admin ALL=(ALL) ALL
After that I remove the admin group and its entries from /etc/group. If you want to keep the admin group, just remove the normal user with sudo privileges from the admin group section in /etc/group.
Can you clarify a little reddazz, i.e. when I try to log in from command line as root - logically I open a terminal and do su/rootpassword, but when I issue visudo, it keeps telling me that the sudoers file is busy - I mean, if I'm not actually using sudo at the time, I don't follow why it might be busy ????
Or are you logging in as root at CLI in some different way?
I log as the admin user, then set a password for root using "sudo passwd root". I then log out from the admin user account and login properly as root and run visudo.
Perhaps if tell us what you wish to accomplish and why we can come up with perhaps a better solution than removing sudo. Perhaps you're more accustomed to su like with SuSE. If you just don't want to be "annoyed" by typing sudo, much of what requires root login can be accomplished with a scrip in Nautilus. If you have to ask "how do I," you may be better asking "this is my problem, what should I do?"
I can see your point both. It's mainly my preference, i.e. all the distros that I've used before (mandriva, SuSE, gentoo, slackware, debian) have all been conventional inasfaras root and user "and ner the twain shall meet".
I'm not convinced that the ability to screw up just by typing sudo infront of a command is particularly a good idea - I can see why it might have been implemented here (with the "buntu's" that it), they are all about ease of use (nice, well developed base distro, excellent package manager in apt, etc etc).
I just prefer to admin my system in the more conventional way, so that everything is nicely seperated in a full multi-user way.
The real power of sudo lies in the sudoers file. Ubuntu's default sudo file leaves a little to be desired as you're right, just by fat fingering with sudo in front of a command you can screw stuff up. But your sudoers file should really limit the commands each user/group can execute as opposed to
Code:
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
Really it should be restricted more than that to only allow those tasks deemed really necessary.
As to whether sudo is better than using su, I would generally agree that sudo is better solely because you're only running ONE command as root. I had a friend enter the linux world who su'd to root and forgot, then did some things that really hosed up his user account because he was root the whole time. Not unrecoverable, but a bit of a pain to fix. If he had sudo, he might have screwed up one thing, but wouldn't have done a whole string of things...
Oh, I would venture to guess that you could uninstall sudo and it would probably remove a bunch of meta-packages (the actual packages should stay in place). At least in Debian nothing depends on sudo. I guess Ubuntu might have changed that so that some key system components do depend on sudo...
sudo was culture shock to me as well. I will have to admit, it's growing on me a bit. There are time when being root the way we're used to just works better. If try booting into Recovery you'll get a pleasant surprise. Level 3 as root without X. This is a great place to install Nvidia drivers from their site. Ubuntu let's you go to a level 3 session but X is still running and prevents some types of updates. Recovery gives me the old way again. The next thing to look at is Nautilus scripts. There are two I use that allow root access to functions without having to open a terminal window. To use them you just place them in /home/{user}/.gnome2/nautilus-scripts. On any file in Nautilus, right click and select the script you want to run. I have one that opens as root the application you would get if you just clicked the file icon. Great for changing root permissions on a file or editing a configuration file with gedit. "Open as Administrator" is a 3 line script:
for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; do
gksudo "gnome-open $uri" &
done
Note that your password will still be required. I also use a bash script for "Xterm here" that opens a terminal window with the directory set to the one your viewing in Nautilus. A real time savor. These techniques will remove the tedium of sudo for most actions with blocking you from the benefits when it just makes sense to use it. Hope this helps you exist in the world of sudo.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.