Password on File

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Password on File
# 1  
Old 07-27-2007
CPU & Memory 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

# 2  
Old 07-27-2007
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.
# 3  
Old 07-27-2007
thanks for your reply
yes root has all access Smilie
i m googling too about it and hope that someone will come up with some solution
# 4  
Old 07-27-2007
password for files

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.Smilie
# 5  
Old 07-27-2007
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.
# 6  
Old 07-27-2007
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
# 7  
Old 07-30-2007
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.

Last edited by Yogesh Sawant; 07-30-2007 at 02:34 AM.. Reason: corrected a typo
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Forum Support Area for Unregistered Users & Account Problems

Password sent via reset password email is 'weak' and won't allow me to change my password

I was unable to login and so used the "Forgotten Password' process. I was sent a NEWLY-PROVIDED password and a link through which my password could be changed. The NEWLY-PROVIDED password allowed me to login. Following the provided link I attempted to update my password to one of my own... (1 Reply)
Discussion started by: Rich Marton
1 Replies

2. UNIX for Dummies Questions & Answers

Zip a file with password

Hi, newbie to Linux, is there another way to zip a file with a password other than using 'zip' command? (7 Replies)
Discussion started by: mined
7 Replies

3. UNIX for Dummies Questions & Answers

SSH password from file

Hi Admin I'm trying to execute on a script which in my production server. The production server has to phase login. First, we need to login to a Taxi server by opening a putty session from there we need to login to production server. Both servers using same LDAP id so I am able to login with... (7 Replies)
Discussion started by: senthil.ak
7 Replies

4. Shell Programming and Scripting

Password Protecting a File

Hi Guys, I am generating a csv file using a shell script in Unix. Please can you guys advise if I can also password protect the file. Best Regards, Shaz (5 Replies)
Discussion started by: Shazin
5 Replies

5. UNIX for Dummies Questions & Answers

password protect a CSV file: better solution than ZIP password?

Hi We send *.csv with sensitive data to our customers. Our customers open those files with Excel. A new requirement is that we password protect those CSV files. I thought to pack them with ZIP and assign a password to the archive. But Solaris 10 can't encrypt ZIP files. $ zip -P... (12 Replies)
Discussion started by: slashdotweenie
12 Replies

6. Shell Programming and Scripting

Password Protecting a File

hello there. Is there a way to password protect a file and make it so that several passwords can open it? i'm trying to write a script that open up a file if the password given by a user is one of many other passwords in the database of the file. not sure if this is possible. thanks the... (2 Replies)
Discussion started by: SkySmart
2 Replies

7. UNIX for Advanced & Expert Users

Problem in converting password protected excel file to csv file in unix

I need to convert a password protected excel file which will be in UNIX server to a comma separated file. For this I need to open the excel file in UNIX box but the UNIX box doesn't prompt for password instead it is opened in an encrypted manner. I could manually ftp the excel file to local... (2 Replies)
Discussion started by: Devivish
2 Replies

8. Shell Programming and Scripting

how to change root password using shell script with standard password

Hi Friends. I am new to scripting now i want to change the root password using the script with standard password. which is the easy scripting to learn for the beginner, Thanks in advance. (2 Replies)
Discussion started by: kurva
2 Replies

9. UNIX for Dummies Questions & Answers

Password protect a file

I have created a PHP page that I use to clean files on my machine. I would like to leave the file there but I want to password protect it so that I am the only one that can run it from the shell. Does anyone know how to do this? Thanks. -Cam (2 Replies)
Discussion started by: perryl7
2 Replies

10. UNIX Desktop Questions & Answers

File password.

Hello, Is there a way to protect a file with password on opening the file. Thank You (3 Replies)
Discussion started by: satish
3 Replies
Login or Register to Ask a Question

Featured Tech Videos