LinuxQuestions.org
Register a domain and help support LQ
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-17-2012, 01:33 AM   #1
waddles
Member
 
Registered: Sep 2012
Posts: 372

Rep: Reputation: 1
setting myself up with sudo


I see in the web that there are several ways to set up /etc/sudoers to allow myself to execute commands as if I were root.
1) add myself to wheel group and setup wheel to ALL by removing the # from that linel
2) add myself as xxxx ALL=(ALL) ALL beneath root ALL=(ALL) ALL.
Can I do it this way so as not to have to respond with password:
xxxx ALL=(ALL) nopasswd:ALL
3) add myself for specific commands in /etc/sudoers
4) or make myself a member of sudo group.
Obviously, #3 is the safest but for myself wouldn't #2 be acceptable. Since this is a single user system I am presuming the nopasswd mode should be OK.
Becoming a member of sudo or wheel group does NOT seem to be the most secure.
What if I were to have a copy of sudoers which had no users and copied that to /etc/sudoers when on the internet and another to copy to sudoers when off the web. If these 2 files were made very secure would this be considered a secure means?
Do I have the approaches correct as I seen several to employ and after an extremely long time in computer science this is the second time I have had to fiddled with sudo.
 
Old 12-17-2012, 02:48 AM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,651
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
While the second option is a viable option for a single user system, the NOPASSWD option is not. This is basically the same as logging in as root which is a bad idea if your system is exposed to the net.

I personally use su for administering the system, with a few selected commands that I use very often, setup with sudo without password.
 
1 members found this post helpful.
Old 12-17-2012, 02:50 AM   #3
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7
Posts: 866

Rep: Reputation: 110Reputation: 110
I normally do your 2nd method but I leave nopasswd option off. If you are working in command prompt and once you issue the command "sudo <yourcommands>" you won't have to keep reentering your password over and over. Its a little safer and I would go with that route.
 
Old 12-17-2012, 06:39 AM   #4
lkraemer
Member
 
Registered: Aug 2008
Posts: 111

Rep: Reputation: 10
waddles,
Here is a good website with lots of good information.
http://gnu-linux-slackware.blogspot....oers-file.html

Thanks.

Larry
 
1 members found this post helpful.
Old 12-17-2012, 04:33 PM   #5
yars
Member
 
Registered: Apr 2012
Location: Russia
Distribution: Slackware
Posts: 137

Rep: Reputation: 13
I think that is simple and securely to use the 3th variant. But I don't have a big set of the commands, mount and umount only... For administrative tasks I use 'su -' and 'su -c "command -arguments"'
 
Old 12-20-2012, 08:16 AM   #6
psionl0
Member
 
Registered: Jan 2011
Distribution: slackware_64 14.1
Posts: 634
Blog Entries: 2

Rep: Reputation: 96
Quote:
Originally Posted by yars View Post
I think that is simple and securely to use the 3th variant. But I don't have a big set of the commands, mount and umount only...
Ditto but I also include "shutdown" so that I can shutdown the PC from the fluxbox menu as a user (NOPASSWD: of course).
 
Old 12-22-2012, 04:37 AM   #7
linuxpokernut
Member
 
Registered: Jul 2007
Distribution: Slackware 14
Posts: 237
Blog Entries: 8

Rep: Reputation: 59
I see "solved" but I wanted to say I just add; I myself use wheel with no pass. It's still not the same as root.
 
Old 12-22-2012, 07:26 AM   #8
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,651
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
Quote:
Originally Posted by linuxpokernut View Post
I see "solved" but I wanted to say I just add; I myself use wheel with no pass. It's still not the same as root.
Care to explain why this is not the same as root?
 
Old 12-22-2012, 02:17 PM   #9
linuxpokernut
Member
 
Registered: Jul 2007
Distribution: Slackware 14
Posts: 237
Blog Entries: 8

Rep: Reputation: 59
Quote:
Originally Posted by TobiSGD View Post
Care to explain why this is not the same as root?
It does not have all the same commands. You can try to do a lot of things with sudo and it will say "command not found".
 
Old 12-22-2012, 02:36 PM   #10
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,298

Rep: Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722
Quote:
Originally Posted by linuxpokernut View Post
It does not have all the same commands. You can try to do a lot of things with sudo and it will say "command not found".
That's a problem with the PATH variable (try adding "/sbin:/usr/sbin" to your PATH or just be explicit when referencing commands).
 
Old 12-22-2012, 02:45 PM   #11
linuxpokernut
Member
 
Registered: Jul 2007
Distribution: Slackware 14
Posts: 237
Blog Entries: 8

Rep: Reputation: 59
Quote:
Originally Posted by T3slider View Post
That's a problem with the PATH variable (try adding "/sbin:/usr/sbin" to your PATH or just be explicit when referencing commands).
Ah not a problem for me, just an observation. I still use # frequently.
 
  


Reply


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
LXer: The Ultimate Sudo FAQ To Sudo Or Not To Sudo? LXer Syndicated Linux News 13 04-13-2013 02:36 AM
Sudo -- setting LD_LIBRARY_PATH crosstalk Linux - Software 2 12-12-2012 04:52 PM
Setting up user to use sudo for specific commands kreed Linux - Newbie 6 05-16-2011 05:43 PM
[SOLVED] trouble setting up sudo to allow su - user zrnaqvi Linux - Security 1 11-16-2009 07:42 PM
sudo not setting defaults brainlesspinkey Linux - Security 4 09-11-2005 12:34 PM


All times are GMT -5. The time now is 05:18 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration