SlackwareThis Forum is for the discussion of Slackware 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.
I'm tired of using su -c for everything, and want to use sudo. The only problem is that whenever I go to configure sudo my mind draws a blank on what to add.
So what are some of the things you guys use sudo for?
I use sudo because I'm also tired of using "su -" most of the time.
Don't know how you system is set up actually I mean what you're using it for. Mine is just for personal use, not a server so I just set sudo for everything and with no password
(Sometimes you don't have to chmod the /etc/sudoers file, but I've seen posts where people cannot write to the file because it's read-only)
If you want to use sudo just for some commands, I actually think you need to spend some time and whenever you need a new command add it to the list until it meets your needs.
I posted a reply to a similar question a little bit ago that outlined my thought process for figuring out how to sudo correctly, maybe it will be of some use:
I use sudo on my laptop and I do it the laziest way possible. When I make my user for the machine I add it to the wheel group and in visudo I just uncomment the sudo for wheel option with nopasswd. Takes all of 2 seconds and I can sudo to my heart's content with whatever I wish to do. For this reason I also add, via .bash_profile for my user, /sbin/ and /usr/sbin/ to my PATH.
This is only for my user, though. Should I add any other users to this machine they would not be in the wheel group nor would they get a beefy PATH. I would probably do something similar to drkstr's reference where only certain commands would be given sudo privileges and then aliased for convenience.
On my machine that I use as a server, sudo is not used this way. I have the whole wheel thing set up but I uncomment the option where a password is necessary. I only did that because I'm so used to sudo this and sudo that... I would ssh over to the sever to do something and I would habitually use sudo for something simple and get aggravation. I don't modify the PATH on that machine except to remove .(current directory).
With that being said, though, over time I found that using sudo just as annoying as su -c. Because of the nopasswd option it's clearly preferable but if I'm going to do a series of tasks I'm more apt to using su or even su - if I need something more robust.
Thanks for all the great replies! My computer's mainly for personal use, security isn't too big of an issue, but I don't think I want to allow myself the ability to sudo everything without a password. (I've typed rm -rf once too many )I think using aliases for stuff like using gphoto and MTP drivers along with not having to use a password would be nice. I'll probably add the pkgtools too. Other than that I think I'll add stuff as I go.
Thank you all very much, and if you still have different ways you use sudo I'd love to hear them.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.