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 06-08-2019, 10:56 PM   #1
Captain Brillo
Member
 
Registered: Jul 2018
Location: Capital of Raccoon Nation
Posts: 126

Rep: Reputation: Disabled
how to add user to sudo group


Having trouble with adding users.
The user I added during installation isn't there.
Trying to "adduser" but I'm unable to add any users to the "sudoers" group. At least, that's the group name the error message has.

So how do I get to use "sudo" as an ordinary user?

If I use kuser the group list does not include "sudo"

adduser did not give me an option for that

So how the frack can I use a box if I can't "sudo" ?
What have I missed here?

Last edited by Captain Brillo; 06-08-2019 at 11:17 PM.
 
Old 06-09-2019, 12:43 AM   #2
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 567

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
As root, run:
Code:
visudo
which is a vi editing interface to the sudo configuration file. Near the bottom is a commented out line saying "# %sudo ALL=(ALL) ALL". Uncomment that line, save & exit. That will give all users sudo acccess - probably good enough if you're the only user on the machine. You can also limit sudo access to particular users or groups - see other examples in the configuration file. See also:
Code:
man sudoers
If vi isn't an editor you're familiar with, you can edit the configuration file /etc/sudoers directly with your favourite editor.
 
Old 06-09-2019, 01:06 AM   #3
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 3,962
Blog Entries: 3

Rep: Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889
Remember, both, that it is misuse of sudo to configure it as all-or-nothing. Such misuse is unsafe. Accounts should be granted just enough privilege to accomplish the tasks they need to, no more, no less.

Yes, "man sudoers" is the ultimate reference, but manual pages are not tutorials and the one for sudoers is particularly long. So for the time being I would recommend the online presentation by Michael W Lucas, "sudo: You're Doing It Wrong". He'll have a new edition of "sudo Mastery" out soon, but for the immediate question, the presentation will have to do. There is both video and slides, but it is quite long.
 
Old 06-09-2019, 05:56 AM   #4
Captain Brillo
Member
 
Registered: Jul 2018
Location: Capital of Raccoon Nation
Posts: 126

Original Poster
Rep: Reputation: Disabled
It appears that this install has no "sudoers" group.
The man pages are confusing as heck.

How do I fix this?
 
Old 06-09-2019, 06:05 AM   #5
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 3,962
Blog Entries: 3

Rep: Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889
There is no group "sudoers", just the file /etc/sudoers and the files beneath the directory /etc/sudoers.d/ which contain the configurations.

The whole thing works on whitelisting commands with options. Which specific commands do you want to allow the account to run?
 
Old 06-09-2019, 06:18 AM   #6
Captain Brillo
Member
 
Registered: Jul 2018
Location: Capital of Raccoon Nation
Posts: 126

Original Poster
Rep: Reputation: Disabled
I just want to be able to use sudo when I need to, and not have to logout/in as root.

Having a bugger of a time getting this Slackware working - little issue after little issue - starting to feel like I'm wasting my time.
 
Old 06-09-2019, 06:23 AM   #7
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 567

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Quote:
Originally Posted by Captain Brillo View Post
It appears that this install has no "sudoers" group.
The man pages are confusing as heck.

How do I fix this?
What I do is uncomment the '# %wheel ALL=(ALL) ALL" line and make myself a member of the wheel group. You'll need to logout/login for that to take effect.

You could also make an entry similar to the one for root but substituting your own name e.g. 'fred ALL=(ALL) ALL'. You could further refine that entry by restricting the sudo privilege to a number of particular commands that you may want to use (which is why Turbocapitalist is asking which commands you'll want to run with sudo).
 
Old 06-09-2019, 07:00 AM   #8
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 7,534

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
Quote:
Originally Posted by Captain Brillo View Post
I just want to be able to use sudo when I need to, and not have to logout/in as root.

Having a bugger of a time getting this Slackware working - little issue after little issue - starting to feel like I'm wasting my time.
Seems to me that you are tackling Slackware as it it were Ubuntu. DON'T.
Slackware does things differently, i.e. it has not changed handling things since its inception. All the other distro's have surfaced after Slackware was already established, they may do things differently from Slackware but that does not mean Slackware does them the wrong way.
Think again why you started with Slackware, and ask yourself if you made the right choice. If the answer is "YES" then treat Slackware for the OS that it is.
 
1 members found this post helpful.
Old 06-09-2019, 07:03 AM   #9
Captain Brillo
Member
 
Registered: Jul 2018
Location: Capital of Raccoon Nation
Posts: 126

Original Poster
Rep: Reputation: Disabled
Super!
Unfortunately, visudo has me beat, too.
It opens but I can't do anything, seems to be read-only.
And I'm logged in as root - what's with this?
 
Old 06-09-2019, 07:15 AM   #10
Captain Brillo
Member
 
Registered: Jul 2018
Location: Capital of Raccoon Nation
Posts: 126

Original Poster
Rep: Reputation: Disabled
Alien Bob:
I hear you - but having a bit of trouble with NOT thinking Ubuntu/Mint etc. Thanks for your comment.

I guess part of my problem here is that there's so much documentation in Slack Docs I'm getting overloaded.
 
Old 06-09-2019, 07:34 AM   #11
interndan
Member
 
Registered: Aug 2004
Location: near Marion, Ill
Distribution: Slackware 14.2 64bit on Desktop Slackwarearm on Raspberry PI v1b
Posts: 358

Rep: Reputation: 31
If you have a full system install you can use kdesu for single tasks. Example: from menu -run type kdesu thunar for a root file manager.
 
Old 06-09-2019, 07:43 AM   #12
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 2,967
Blog Entries: 7

Rep: Reputation: 1549Reputation: 1549Reputation: 1549Reputation: 1549Reputation: 1549Reputation: 1549Reputation: 1549Reputation: 1549Reputation: 1549Reputation: 1549Reputation: 1549
Quote:
Originally Posted by chris.willing View Post
If vi isn't an editor you're familiar with, you can edit the configuration file /etc/sudoers directly with your favourite editor.
That's a very dangerous thing to do! Visudo does a syntax check after filing the temporary saved file and before copying it over to overwrite the original. That means that if you made a syntax error, it will be reported and you can go back, double-check the change you made and correct it.

If you edit sudoers directly you don't get that check. And if sudoers is saved with a syntax error in it, sudo won't work any more.

The right way to do this is to set the EDITOR environmental variable to be your favourite editor and then use visudo.

If it's just a matter of shutting down or rebooting, most sudoers files include an alias for these commands, and you can give yourself sudo access to this (without a password if you like).
 
1 members found this post helpful.
Old 06-09-2019, 07:46 AM   #13
Captain Brillo
Member
 
Registered: Jul 2018
Location: Capital of Raccoon Nation
Posts: 126

Original Poster
Rep: Reputation: Disabled
Can somebody explain why "visudo" seems to be read-only?
 
Old 06-09-2019, 08:03 AM   #14
Captain Brillo
Member
 
Registered: Jul 2018
Location: Capital of Raccoon Nation
Posts: 126

Original Poster
Rep: Reputation: Disabled
Thanks, all.
Finally managed to get at the "sudoers" file, and modified it like chris.willing suggested.
Now I'm ok.
 
Old 06-09-2019, 08:05 AM   #15
jmccue
Member
 
Registered: Nov 2008
Location: US
Distribution: slackware
Posts: 306

Rep: Reputation: 139Reputation: 139
Quote:
Originally Posted by Captain Brillo View Post
Can somebody explain why "visudo" seems to be read-only?
Are you executing visudo as root ? If so, what makes you think it is read-only, visudo will create a temp file, you change that then /etc/sudoers will be updated when you save and exit

EDIT - looks like Captain figured it out while I was typing this

Last edited by jmccue; 06-09-2019 at 08:07 AM.
 
  


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
[SOLVED] How to add a user to a group with a command without removing from another group? erik2282 Linux - Newbie 2 07-12-2017 09:49 AM
LXer: The Ultimate Sudo FAQ To Sudo Or Not To Sudo? LXer Syndicated Linux News 13 04-13-2013 01:36 AM
Block bitmap for group 416 not in group (block 0) + group descriptors corrupted? quanta Linux - Server 1 12-08-2010 10:40 AM
group: add complete group into other group max_mad SUSE / openSUSE 1 04-12-2006 01:43 AM
Group Admin, Group Root, or God over Group crickett Linux - General 5 07-12-2004 04:01 PM

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

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