Password on File

hi , have a nice day

i need some help on this , lets suppose i have a script at certain path , i can set its attributes with chmod but since me and all my colleagues have "root" access on that machine so chmod wont do the job
i want them all to only be able to execute this script but cant read/write its contents so only thing which came in my mind is that is there someway that i can set a password on that file which pops for password once someone tries to read it and only allows to read/write if correct password is supplied

Regards

Thats an interesting question you post. For some reason sudo popped into my head. The only thing with sudo is root has all access. Maybe there is a way to configure that differently.

thanks for your reply
yes root has all access :mad:
i m googling too about it and hope that someone will come up with some solution
Regards

Oh what a relief it would be , b'coz I too am facint the same problem since
long and there are situation like you with me too . So many times I have
given a thought but in vain. If solved it will be a great relief for alike
programmer or sys adm, world over. Thanx in advance if some GURU
and provide some light on the subject.:confused:

One of the solutions would be to not use shell script.

Instead, write it in a compiled language.

Do the following:
1) Write, maintain and keep the source code in a text file outside of unix.
2) Whenever you need to change it:
2.a) Copy and paste the souce code into your unix machine.
2.b) Change it in unix.
2.c) Compile it in unix.
2.d) After satisfied with the change, copy and paste it back outside of your unix box.
2.e) Delete the source code from unix.

If people really want, they can reverse engineer your code, but, if someone
gets to the extreme of doing this, you are facing serious breach of security
in your system and need professional law enforcement help.

I googled for "encrypted shell script". I've never used it, but you might look at "shc"
Encrypting Shell Scripts - The Community's Center for Security

another option is create a C program or Perl script that does the job of your existing script. Then keep the source code only with you at some place where others don't have access to it (some other system). Keep the executable file at the place where your colleagues can execute it.

Making a C program that does the work of a shell script might be a tedious job. Making a Perl script would be comparatively easy. You can create an executable file from the Perl script. You will have to choose between one of these two options.