Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2003
    Posts
    6

    Unanswered: chown a root file in a script

    We have a log file that always gets created as root:other and to clear this log I have to su - root to change the permissions. I attempted to create a quick script so that a user would not have to su - root.
    Just a simple
    #!/bin/sh
    chown mark:dev /export/home/test

    I figured if I set it as 755 I would be able to run it as any user to modify the test file. No can do I receive the old
    chown: /export/home/test: Not owner

    Does any one know of a way to do this?

    Thanks
    MC

  2. #2
    Join Date
    Oct 2003
    Location
    Germany
    Posts
    138
    quick and dirty solution :

    make an entry in root crontab with following row:

    * * * * * chmod 755 /export/home/test
    Last edited by fla5do; 12-15-03 at 19:33.
    Greetings from germany
    Peter F.

  3. #3
    Join Date
    Sep 2003
    Posts
    7
    why cant you use SetUID ?

  4. #4
    Join Date
    Feb 2003
    Posts
    6

    Thumbs up

    Originally posted by skrishnaswamy
    why cant you use SetUID ?
    Iknew there was a way, exactly what I was looking for.
    Thanks
    MC

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •