Linked Questions

31 votes
1 answer
43k views

I want to ensure that my program can only be run by user xyz using root privilege. To do this, I set the setuid bit with: chmod u+s program1.sh ls -l program1.sh rwsr-x--- 1 root house 1299 May 15 23:...
Marcus Thornton's user avatar
5 votes
1 answer
4k views

I have some bash scripts that I use with the user 'root' to manage iptable rules. The problem is that I want these things at the same time: The script must be owned by root Permissions must be 700 I ...
ChocoDeveloper's user avatar
3 votes
1 answer
4k views

My os is Fedora 24 and I tried to test the suid bit functionality. I wrote below bash as Setuid.bash: #!/bin/bash if [ $USER = 'root' ] then echo "Like Root Run" echo "Root User Add in " $(...
Hossein Vatani's user avatar
1 vote
1 answer
5k views

I created a simple bash script which contains the command ifconfig. In general I want to execute such a privileged script to run as non-root user. I have tried hown root:users ./path/to/script.sh ...
3bdalla's user avatar
  • 441
0 votes
2 answers
1k views

As an experiment in playing with the suid bit, I tried writing a script to run apt-get update from a bash script, and then set the suid bit on it, so I could just run ~/update or something. apt-get ...
Squidly's user avatar
  • 445
1 vote
1 answer
1k views

I created a small script as the root user... #!/bin/bash cat /etc/shadow and set the setuid bit and placed it within the guest folder. When I ran the script as guest, it showed permission denied. ...
1zverg's user avatar
  • 331
0 votes
1 answer
813 views

I find php files with SGID bit and read-only & execute. The group is root. Is this a problem? Because a user will need to run the php interpreter with their our account, could it led to privilege ...
Rodrigo's user avatar
  • 101
0 votes
0 answers
744 views

I have the following script: $ ls -al setprog.sh -rwsrwxr-x 1 root root 52 Αυγ 2 10:23 setprog.sh $ cat setprog.sh #!/bin/bash while [ True ] do echo $(whoami) done When running it $ ./...
pkaramol's user avatar
  • 3,109
1 vote
1 answer
513 views

I am learning about setuid and setgid where the user executing the script will inherit the owner's permission while running the script. To test this, I created a bash as user fiverr in /home/fiverr/...
Raza's user avatar
  • 113
0 votes
0 answers
204 views

I want to run a command automatically. The problem is that it may only be run after I logged in and that it requires superuser privileges. I've heard of suid before, so I thought I'd use it for this. ...
UTF-8's user avatar
  • 3,377
0 votes
1 answer
79 views

I have two users first being ace and the second being ej ace has a file in its home directory, which is a shell script, with the following permission set ( setuid i have used ) -rwsr--r-x 1 ace ace 15 ...
Yanjan. Kaf.'s user avatar
2 votes
0 answers
63 views

So from what I understand, SUID makes so that when you execute a file, you're basically executing it under root, right? Now I made this file, and whenever I try to run it, I get a permission denied ...
user323587's user avatar
3 votes
0 answers
30 views

I have a script: [postgres@LaHarch ~]$ cat mkrundir.sh #!/bin/bash mkdir /run/postresql With attributes: [postgres@LaHarch ~]$ ll mkrundir.sh -rwsr-sr-x 1 root root 74 Aug 26 18:53 mkrundir.sh ...
Артем Максимов's user avatar
252 votes
15 answers
559k views

I need to run something as sudo without a password, so I used visudo and added this to my sudoers file: MYUSERNAME ALL = NOPASSWD: /path/to/my/program Then I tried it out: $ sudo /path/to/my/program ...
LanceBaynes's user avatar
  • 41.6k
89 votes
9 answers
96k views

Is it possible to execute a script if there is no permission to read it? In root mode, I made a script and I want the other user to execute this script but not read it. I did chmod to forbid read and ...
ashim's user avatar
  • 1,057

15 30 50 per page
1
2 3 4 5