Can I set the password for a script??!!
Can I set the password for a script such that if I want to run that script I need to provide the correct password. Is it possible in bash scripting?
|
It's possible using the attribute available on the OS.
For example root script require you specify the password for have the privileges to run it. |
ok. But how to do that?
|
Yes there are various ways both secure (encrypted) or easily discovered if not encrypted.
Here is a link that might help http://wiki.tcl.tk/3594 Try some google searches for more introductry information. |
Simple way:
Create a user "runit" The script you want to protect is /usr/bin/yourscript Code:
# chown runit /usr/bin/yourscript Code:
su - runit /usr/bin/yourscript Code:
# chmod 755 /usr/bin/doit |
You could also look at sudo http://linux.die.net/man/8/sudo
|
pcunix,
Whatever you said I close to my requirement. But, I want to use a password for a specific script which means that I can run that script by providing that password rather than some other user's password. |
Quote:
|
you can encrypt it using gpg -c <Script name>
|
Quote:
|
Is it possible to use pam facilities? :twocents:
|
All times are GMT -5. The time now is 10:11 AM. |