LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   setting myself up with sudo (https://www.linuxquestions.org/questions/slackware-14/setting-myself-up-with-sudo-4175441733/)

waddles 12-17-2012 12:33 AM

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.

TobiSGD 12-17-2012 01:48 AM

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.

jmc1987 12-17-2012 01:50 AM

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.

lkraemer 12-17-2012 05:39 AM

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

Thanks.

Larry

yars 12-17-2012 03:33 PM

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"'

psionl0 12-20-2012 07:16 AM

Quote:

Originally Posted by yars (Post 4851185)
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).

linuxpokernut 12-22-2012 03:37 AM

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.

TobiSGD 12-22-2012 06:26 AM

Quote:

Originally Posted by linuxpokernut (Post 4854857)
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?

linuxpokernut 12-22-2012 01:17 PM

Quote:

Originally Posted by TobiSGD (Post 4854903)
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".

T3slider 12-22-2012 01:36 PM

Quote:

Originally Posted by linuxpokernut (Post 4855070)
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).

linuxpokernut 12-22-2012 01:45 PM

Quote:

Originally Posted by T3slider (Post 4855089)
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.


All times are GMT -5. The time now is 07:56 AM.