Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 12 months ago.
Improve this question
I have this rule in my sudoers file
user ALL = (root) NOPASSWD:/usr/bin/supervisorctl
Now I can run the command without root password.
For example :
sudo supervisorctl restart all
My question is How can I run the command without sudo command ?
For example :
supervisorctl restart all
You should be able to make that work by setting the sticky flag:
sudo chmod +s /usr/bin/supervisorctl
You can try this out using whoami:
cp /usr/bin/whoami /tmp/whoami2
sudo chown root:root /tmp/whoami2
sudo chmod +s /tmp/whoami2
If you then run ./tmp/whoami2 as any user, you'll get root, i.e., the executable executes as the user with owner, given the sticky flag.
Related
Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 months ago.
Improve this question
someone ask me but don't know The script install.sh requires elevated permissions to execute. Which command should be used to set execution permission?
chmod -r install.sh
chmod +x install.sh
chmod 400 install.sh
chmod -R 400 install.sh
chown install.sh
Firstly, the file should be owned by the correct user. If yes, then executing chmod +x install.sh or chmod 755 install.sh should give execute permission to that file
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I have permissions issue with www-data (apache) and just a linux user.
In my www folder is wp/
If I set:
sudo chown -R user.www-data wp/
My wordpress shows info it can write to a file, but if I set sudo chown -R www-data.user wp/ then WP works fine, but I can't create/delete folders/files in that directory in a file manager.
I've also added user to www-data group and www-data to user group, but it doesn't help. Still the same problem. What I'm doing wrong and how to solve this?
Try looking into chmod instead of chown.
Also, when using either of those commands, the syntax is user:group.
One solution is to chown -R user:www-data wp/
And then chmod -R 775 wp/
That will give both the user and the group www-data full access to the folder.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I am trying to change access rights on tomcat-users.xml file under Linux Mint by:
chmod ugo+rwx tomcat-users.xml
But I'm receiving this error message:
Operation not permitted
tomcat-users.xml has the following permissions and attributes:
$ ls -la tomcat-users.xml
-rw-r-r-- 1 root root tomcat-users.xml
$ lsattr tomcat-users.xml
---------------e--- tomcat-users.xml
What am I doing wrong?
This command is correct is all ways but if there is an issue the, probably you would have been changing permissions of a file from a user(except root) who is not owner of the file.
Or if the owner is root then switch to it.
Or run the command from root.
And still does not work then go for
chmod u=rwx,g=rwx,o=rwx tomcat-users.xml
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I am trying to start my exampleService.service with systemctl, without logging as root.I have created group called testGroup and added my account there - testAccount.My service file is located at /etc/systemd/system and I have created file testConfig in /etc/sudoers.d with the following content :
%testAccount ALL= NOPASSWD: /etc/systemd/system start exampleService.service
%testAccount ALL= NOPASSWD: /etc/systemd/system stop exampleService.service
%testAccount ALL= NOPASSWD: /etc/systemd/system restart exampleService.service
also the line #includedir /etc/sudoers.d is present in the sudoers file.Now when I try to start the service as : systemctl start exampleService.service (logged in as testAccount ) I get pop-up to enter password,but it shouldn't be required.Where can be the problem in my configuration?
Add below line in /etc/sudoers file
testAccount ALL= NOPASSWD: ALL
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 5 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I have to create a shared folder under a directory, after that I have to create 2 users with their equally named home directories. It is required that the user can use the sudo command and both users should be able to edit each other's documents in the shared folder.
Can someone help me out with this? or give me the code, I tried adding users to the directory and stuff but I am stuck and also don't really understand the full exercise.
thank you
Creating the shared directory and common group
$ sudo mkdir -p /var/test
$ sudo groupadd test
Add the two user to the group
$ sudo usermod -a -G test user1
$ sudo usermod -a -G test user2
Set the permission to directory
$ sudo chgrp -R project /var/test/
$ sudo chmod -R 2775 /var/test/