You are not logged in.

#1 2021-05-09 17:07:59

abott
Member
Registered: 2021-05-09
Posts: 8

How to make a standard user install packages?

Why i am asking this question?

- I wanted to install nodejs and then i remembered, some software inhibit the installation when you try to install them through root( so they can't have administrator privileges).
  so i was wondering if i can install nodejs with little privilege.

I don't want to do su or sudo, I guess i need to add the user in some group but not sure how to actually do it.

Thanks

Offline

#2 2021-05-09 17:22:33

loqs
Member
Registered: 2014-03-06
Posts: 19,013

Re: How to make a standard user install packages?

You need to be root or have root privileges to install packages using pacman.  su and sudo can temporarily grant those privileges.  If you do not use a temporary privilege escalating approach you would need the user to permanently have root privileges which would in effect be no different from being root.

How exactly are you trying to install nodejs?  Why do you not want to use sudo?

Offline

#3 2021-05-09 17:32:48

abott
Member
Registered: 2021-05-09
Posts: 8

Re: How to make a standard user install packages?

I don't know much about exact difference between su and sudo in terms of security. I am just trying to find out best practice to install a software (in my case nodejs) in a system.

Offline

#4 2021-05-09 17:43:12

loqs
Member
Registered: 2014-03-06
Posts: 19,013

Re: How to make a standard user install packages?

loqs wrote:

How exactly are you trying to install nodejs?

Do you mean this package https://archlinux.org/packages/community/x86_64/nodejs/ using pacman or some other nodejs package using some other tool?

Offline

#5 2021-05-09 17:54:59

abott
Member
Registered: 2021-05-09
Posts: 8

Re: How to make a standard user install packages?

Offline

#6 2021-05-09 17:57:46

loqs
Member
Registered: 2014-03-06
Posts: 19,013

Re: How to make a standard user install packages?

Sudo covers the difference from su and also documents how to configure sudo.

Offline

#7 2021-05-09 18:06:37

abott
Member
Registered: 2021-05-09
Posts: 8

Re: How to make a standard user install packages?

Thanks, I used to use sudo but recently i see some people use su everytime, and i started using su too instead of sudo. But i guess sudo provides better security.

But can i limit a sudo user privilege, for eg. as i understood

 USER_NAME   ALL=(ALL) ALL 

gives all access to user with USER_NAME, can we limit it only run specific commands?

can we do it like this:

 USER_NAME HOST_NAME=/usr/bin/halt,/usr/bin/poweroff,/usr/bin/reboot,/usr/bin/pacman -Syu 

I am not sure about HOST_NAME part, should i put the hostname of the system?

Offline

#8 2021-05-09 18:13:03

loqs
Member
Registered: 2014-03-06
Posts: 19,013

Re: How to make a standard user install packages?

If the hostname never changes you can use the actual hostname instead of HOST_NAME otherwise use ALL.

Last edited by loqs (2021-05-09 18:13:34)

Offline

#9 2021-05-09 18:18:56

abott
Member
Registered: 2021-05-09
Posts: 8

Re: How to make a standard user install packages?

I am also wondering,

 USER_NAME   ALL=(ALL) ALL 

in this first ALL is for hostname so what does second and third ALL represents?

Offline

#10 2021-05-09 18:24:50

loqs
Member
Registered: 2014-03-06
Posts: 19,013

Re: How to make a standard user install packages?

https://man.archlinux.org/man/sudoers.5 … cification

The basic structure of a user specification is “who where = (as_whom) what”.

Offline

#11 2021-05-09 18:30:15

abott
Member
Registered: 2021-05-09
Posts: 8

Re: How to make a standard user install packages?

Many thanks!

Offline

Board footer

Powered by FluxBB