this post was submitted on 06 Jun 2024
4 points (66.7% liked)

linux4noobs

1340 readers
1 users here now

linux4noobs


Noob Friendly, Expert Enabling

Whether you're a seasoned pro or the noobiest of noobs, you've found the right place for Linux support and information. With a dedication to supporting free and open source software, this community aims to ensure Linux fits your needs and works for you. From troubleshooting to tutorials, practical tips, news and more, all aspects of Linux are warmly welcomed. Join a community of like-minded enthusiasts and professionals driving Linux's ongoing evolution.


Seeking Support?

Community Rules

founded 1 year ago
MODERATORS
 

I would like to set a specific command to not require sudo privileges, is there a way to accomplish this? I know you can add commands to the sudoer file to allow certain commands to be used by non root accounts, so maybe there is something similar for adding commands to allow regular users to use?

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 4 points 5 months ago (1 children)

since it can lead to security vulnerabilities.

Most software isn't written to be hardened for that kind of invocation.

Also, IIRC you can also do the same thing with the sgid bit.

goes to check

Yeah.

$ mkdir test
$ cd test
$ cp /bin/id ./
$ ls -ln id
-rwxr-xr-x 1 1000 1000 48144 Jun  6 10:56 id
$ ./id -g
1000
$ sudo chgrp 1001 id 
$ sudo chmod g+s id 
$ ./id -g
1001
$ ./id -gr
1000
$ 
[–] [email protected] 2 points 5 months ago* (last edited 5 months ago) (1 children)

True, SGID would affect the group it runs as, while SUID affects the user.

You could set up things so that a group has permissions to do what you want, instead of the root user. But then this also depends on the usecase, I'm not sure if having root group permissions would be enough in all cases.

[–] [email protected] 2 points 5 months ago

Thank you both