Operating System - HP-UX
1833828 Members
1984 Online
110063 Solutions
New Discussion

Writing to a file owned by root

 
Keith Meloy_1
Occasional Advisor

Writing to a file owned by root

I have some scripts that users run as part of logging on/off to HP-UX 10.20 and I would like to gather some statistics.
Can I make these scripts, which are being run by users, write to a file that is owned by root?
I do not want users to be able to write to the file other than via the scripts.

Thanks

Keith
4 REPLIES 4
Steven Sim Kok Leong
Honored Contributor

Re: Writing to a file owned by root

Hi,

Have you tried sudo yet? sudo will allow you to run the scripts with superuser privileges and also allow you to restrict who can run these scripts.

Hope this helps. Regards.

Steven Sim Kok Leong
Tom Geudens
Honored Contributor

Re: Writing to a file owned by root

Hi,
Steven is right, sudo will do the trick ...
More info on sudo : http://www.courtesan.com/sudo/
You can download a depot (for swinstall) at http://hpux.tn.tudelft.nl/

Tom
A life ? Cool ! Where can I download one of those from ?
Niraj Kumar Verma
Trusted Contributor

Re: Writing to a file owned by root

Hi,

you acn do it using sticy bit
just like temp.

create a directory using
drwxrwxrwxt directory

let all the user create a user info file for e.g,

File1_user
file2_user in that directory

--Niraj
Niraj.Verma@philips.com
Deepak Extross
Honored Contributor

Re: Writing to a file owned by root

Just a word of caution - in case you are going in for the sticky-bit solution, make sure that the users done have write permissions on the scripts.