Operating System - HP-UX
1846425 Members
2872 Online
110256 Solutions
New Discussion

Re: Scripting/permission help needed

 
Sreejith Kaliyam
Regular Advisor

Scripting/permission help needed

Hi,

I have one script whiche create some report (say a.exe)and this file reads password info from another file(b.ini).I dont want user to view the password(b.ini) but excute the report script.I tried with SUID,But didnt help. Can any bodygive some input to achive this (script/permmission)

Thanks in advance

Anoop
6 REPLIES 6
Rajeev  Shukla
Honored Contributor

Re: Scripting/permission help needed

Hi Neil,

Use sudo for this case which will run your a.exe script as user and read the b.ini (password file)

Change the permission of b.ini file to 000 to no one can read it and then use sudo
sudo -u -s "command"

download sudo from here
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/sudo-1.6.8p6/

cheers
Rajeev
Sreejith Kaliyam
Regular Advisor

Re: Scripting/permission help needed

Hi rajeev,

Thanks for your reply
How do I create /etc/sudoers file

Anoop
Mehmood Ansari
Frequent Advisor

Re: Scripting/permission help needed

Hi Desai

If you down loaded sudo go to /usr/local/sbin
than type ./visudo you will see example how to defined the command and permission.

Sreejith Kaliyam
Regular Advisor

Re: Scripting/permission help needed

Hi

I am little confused with it's man pages.Can you post some examples??

Thanks & regards

Anoop
Rajeev  Shukla
Honored Contributor

Re: Scripting/permission help needed

Here is what syntax u'll have in /etc/sudoers file

usr1 system1 = NOPASSWD: /bin/kill, /bin/ls

this means a usr1 on system1 can run commands like /bin/kill and /bin/ls as root without being prompted for password

Have a look at the man pages of sudoers u'll have more options like if you want to be prompted for password or want to run as someother user etc..

Cheers
Rajeev
Sreejith Kaliyam
Regular Advisor

Re: Scripting/permission help needed

Thank you all