how to run root command having normal user permission
Hi,
I want to run some root commands.I am having normal user permission.I have tried with setuid bit? i followed followig steps. $ cp mkdir ~/test $ chmod 4776 test $ ls -l test -rwsrwxrw- 1 u03125 b-03 20888 2006-03-07 17:49 test $ ./test /usr/bin/ttfonts ./test: cannot create directory `/usr/local/bin/ttfots':permission denied can any body help me out how to do this? |
The SETUID bit means the command will run as the owner of program and not as the current user.
To this work, you need to change the owner of test from u03125 to root: "chown root test". cheers |
hi this is also saying
"failed to change ownership of `test' to root chown: changing ownership of `test': Operation not permitted " what the cause of it? |
Only root can do that ! ;)
Otherwise, this will be a big security hole, isn't ? |
You need to be root for "chown root test".
|
OP wants to know how to run commands that need root access, but he does not have that...right?
Only option is sudo. If you do not have adequate privileges using sudo, then you need to find the administrator for the machine. |
I'm trying to do the same thing. I'm trying to run a script as a normal user but I want to write a file to a location that only root can.
Code:
-rwsrwxrwx 1 root root 37 May 21 10:44 writetest.sh Code:
#!/bin/bash Any ideas? -twantrd |
Argh, nevermind. Went drinking last night. Anyhow, Linux doesn't read the suid bit on scripts.
-twantrd |
All times are GMT -5. The time now is 01:18 AM. |