LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Added a new user to the sudoers file but I can't use "installpkg" with that account (https://www.linuxquestions.org/questions/slackware-14/added-a-new-user-to-the-sudoers-file-but-i-cant-use-installpkg-with-that-account-4175695769/)

fresh_orange_0 05-29-2021 01:34 PM

Added a new user to the sudoers file but I can't use "installpkg" with that account
 
Hello,

Added a new user to the sudoers file but I can't use "installpkg" with that account

What else do I need to do in order to use "installpkg" with the new user that is now in the sudoers file?

Thank you very much!

pan64 05-29-2021 01:43 PM

how did you do that? I mean: how did you add it to the sudoers file and how did you try to run installpkg?

fresh_orange_0 05-29-2021 01:56 PM

Added it to the sudoers file in the following way:

Quote:

username ALL=(ALL) ALL
And tried to use from <username> the installpkg command with:

Code:

sudo installpkg
The output was:

Code:

sudo: installpkg: command not found

hendrickxm 05-29-2021 02:13 PM

/sbin is probably not in your path. Try /sbin/installpkg instead.

fresh_orange_0 05-29-2021 02:17 PM

Quote:

Originally Posted by hendrickxm (Post 6254960)
/sbin is probably not in your path. Try /sbin/installpkg instead.

Thank you very much! That solved the problem

Anything else I should add to my path?

hitest 05-29-2021 02:34 PM

On a related note I always use the following command to set-up sudo for my regular user.

# visudo

bassmadrigal 05-29-2021 02:57 PM

Uncomment this line and your path with be updated when using sudo.

Code:

# Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

fresh_orange_0 05-29-2021 04:29 PM

Quote:

Originally Posted by bassmadrigal (Post 6254964)
Uncomment this line and your path will be updated when using sudo.

Code:

# Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

Thanks!

chrisretusn 05-29-2021 08:49 PM

When I see post like this I wonder why folks just don't 'su - root'?

chris.willing 05-29-2021 09:39 PM

When I see folks buying a Dodge, I wonder why they don't just buy a Ford.

rkelsen 05-29-2021 09:50 PM

Quote:

Originally Posted by chrisretusn (Post 6255033)
When I see post like this I wonder why folks just don't 'su - root'.

Me too. I'm not a great fan of sudo. If I ever have to do something 'as root', I'll use 'su -' every time.

Thankfully, Slackware's sudo comes with sane default settings.

bassmadrigal 05-29-2021 09:53 PM

Quote:

Originally Posted by chrisretusn (Post 6255033)
When I see post like this I wonder why folks just don't 'su - root'.

Well, because su - requires the root password. You can set up sudo to not require a password or allow a user to have root access for some programs but not for everything.

I have my sudo set up so my user can run any program and without requiring my user's password. Is this more insecure? Yes. Am I aware of that and still do it? Also yes. Is this much faster for me when needing to do root things? Another yes. Am I a stray from the *buntus that got used to using sudo before switching to Slackware? Nope! I started with Red Hat 20ish years ago and then switched to Slackware. Never used the *buntus for any serious amount of time. I just configure my system the way I like it.

I also sometimes do sudo su - when I need to do more than a few commands as root. *gasp*

(Also, you don't need to specify root when running su. It defaults to the root account unless you specify a different user.)

When I see post like this I wonder why folks just don't let others use their machines as they want to?

rkelsen 05-29-2021 10:07 PM

Quote:

Originally Posted by bassmadrigal (Post 6255046)
When I see post like this I wonder why folks just don't let others use their machines as they want to?

That's a bit of an overreaction. You need to settle down a bit.

He was merely posing a question, not telling people what to do.

chrisretusn 05-30-2021 12:26 AM

Quote:

Originally Posted by chris.willing (Post 6255043)
When I see folks buying a Dodge, I wonder why they don't just buy a Ford.

LOL. I wonder the same thing. ;)

bassmadrigal 05-30-2021 01:05 AM

Quote:

Originally Posted by rkelsen (Post 6255051)
That's a bit of an overreaction. You need to settle down a bit.

He was merely posing a question, not telling people what to do.

I just took their statement and turned it on them. Not an overreaction in my book, but others are free to look at it as they desire. I was not worked up in my post. I posted the reason *I* use sudo and included that I am aware that it is insecure. I was not bothered by anything more than questioning the user's choice to make their system their own.

I have no problems with people using su - and typing their root password, so what's the issue with people setting up sudo to use as they desire? I'm glad Pat does sane defaults with sudo and requires users to set it up manually. Hopefully that ensures users understand the implications of setting it up and are making the decision knowingly.


All times are GMT -5. The time now is 10:46 AM.