Howto run a script as root
I created a script as root to remove some symlinks and to copy some files instead of them.
The problem is that I am not able to run the script as root.
As user knoppix I am able to run the script, but do not have the rights to remove the symlinks.
I want to save the script on the harddisk, so it will be there all the time.
As soon as I save it on harddisk the ownership seems to change to knoppix:knoppix
I tried as root:
Code:
chown knoppix:knoppix filename
ownership did not change.
I tried as root:
chmod u+x filename
and
chmod +x filename
root could still not run the script, while knoppix can, but does not have enough rights.
What can I do about this?
Another question is: how do I get the answer on the question if knoppix should remove the symlink answered with yes without human interferance.
Re: Howto run a script as root
Quote:
Originally Posted by Hermanh
I tried as root:
Code:
chown knoppix:knoppix filename
ownership did not change.
I think you should issue a
Code:
chown root:root filename
or try (as root):
Code:
# chmod 777 filename
tom