LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-10-2006, 03:05 PM   #1
dosnlinux
Member
 
Registered: Mar 2005
Distribution: slackware 11, arch 2007.08
Posts: 154

Rep: Reputation: 30
What do you use sudo for


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?
 
Old 12-10-2006, 03:20 PM   #2
Boby
Member
 
Registered: Feb 2004
Posts: 781

Rep: Reputation: Disabled
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

Code:
chmod +w /etc/sudoers
echo 'yourloginname ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
chmod -w /etc/sudoers
exit
(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.

Boby
 
Old 12-10-2006, 04:28 PM   #3
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
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:

http://www.linuxquestions.org/questi...97#post2536497

best regards,
...drkstr
 
Old 12-10-2006, 04:52 PM   #4
zetabill
Member
 
Registered: Oct 2005
Location: Rhode Island, USA
Distribution: Slackware, Xubuntu
Posts: 348

Rep: Reputation: 32
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.
 
Old 12-10-2006, 06:09 PM   #5
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
You can also make an alias:

alias su='sudo su'

so you can su without no pass *if* you put the ALL=(ALL) NOPASSWD:ALL in sudoers file
 
Old 12-10-2006, 08:26 PM   #6
M$ISBS
Member
 
Registered: Aug 2003
Posts: 834

Rep: Reputation: 30
Does that give a particular user root priveledges without having to keep doing su all the time? isnt that kind of insecure?
 
Old 12-11-2006, 02:19 AM   #7
pdw_hu
Member
 
Registered: Nov 2005
Location: Budapest, Hungary
Distribution: Slackware, Gentoo
Posts: 346

Rep: Reputation: Disabled
I use it for gphoto2 and rioutil (software for my mp3 player), also formounting of stuff not in fstab.
 
Old 12-11-2006, 04:20 AM   #8
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
Quote:
Originally Posted by M$ISBS
Does that give a particular user root priveledges without having to keep doing su all the time? isnt that kind of insecure?
That particular alias means that a user can su without pass. The sudoers entry means that a user can 'sudo' a program without pass.

I only use this on my own system where there are no other users so it's quite safe. I wouldn't do this in a multi-user situation.
 
Old 12-11-2006, 07:10 PM   #9
M$ISBS
Member
 
Registered: Aug 2003
Posts: 834

Rep: Reputation: 30
Thanks, I will look into that. Mine is a single user system and I really get frustrated having to type in the root password all the time.
 
Old 12-15-2006, 02:57 PM   #10
dosnlinux
Member
 
Registered: Mar 2005
Distribution: slackware 11, arch 2007.08
Posts: 154

Original Poster
Rep: Reputation: 30
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.
 
Old 12-15-2006, 08:12 PM   #11
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
I don't use sudo, I have found no benefit to using it over su.
 
  


Reply

Tags
aliases, security, sudo


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sudo help chud67 Linux - General 3 07-25-2007 04:05 AM
Restricting Editing in Sudo (Advanced Sudo Question) LinuxGeek Linux - Software 4 11-04-2006 03:20 PM
Sudo without having to type "sudo?" Mitch G Linux - Security 3 09-28-2006 02:16 PM
need help with sudo mla Linux - Software 4 10-02-2003 11:05 AM
sudo? nabil Linux - Security 1 02-12-2001 01:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration