You are not logged in.
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
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
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
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
Yes this https://archlinux.org/packages/community/x86_64/nodejs/ package from pacman.
Offline
Sudo covers the difference from su and also documents how to configure sudo.
Offline
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
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
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
https://man.archlinux.org/man/sudoers.5 … cification
The basic structure of a user specification is “who where = (as_whom) what”.
Offline
Many thanks!
Offline