security for unix korn shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting security for unix korn shell script
# 1  
Old 08-13-2012
security for unix korn shell script

hello

I am using a korn shell script.
I want to make them password protected.
Please suggest some ways to do it.


thanks in advance for your sufggestion !
# 2  
Old 08-13-2012
What are trying to do - not password protect a file but what?
Stop users from reading the file? Stop some users from running the script.

Because this is an unusual request, it seems likely that what you are really after is something that is not so unusual.

For example, you could:
create a user, say scripter.
Assign ownership of the file to scripter
put permissions on the file: rwx------, make sure scripter can execute the directory path
Then setup a login .profile for scripter that traps ctrl-c:
Code:
# .profile for scripter
trap 'exit 1' 2
/path/to/the/script.sh
exit

Now, when someone logs in as scripter the only thing that happens is the script runs, then the user is logged out of scripte right away.

If you are are an environment that has more security requirements you can chroot the account (scripter).

This is a chroot example for Linux: https://help.ubuntu.com/community/BasicChroot
You can google for chroot and get loads of other examples.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

UNIX Korn Shell to Linux Bash

Migrating Unix batch jobs (Korn Shell) running in HP-UX server to Linux environment. Hi All Please help me to understand the easiest way to migrate Kernel Shell scripts to Linux Bash. Also let me know 1. Any automated scripts or tools available for this. 2. Challenges and issues... (5 Replies)
Discussion started by: cpremesh
5 Replies

2. Shell Programming and Scripting

unix korn shell leap years problem

Write a function called dateToDays that takes three parameters -a month string such as Sep, a day number such as 18, and a year number such as 1962-and return s the number of days from January 1, 1900, to the date. Notes: I am asking you to account for leap years. my script is not... (0 Replies)
Discussion started by: babuda0059
0 Replies

3. Shell Programming and Scripting

Unix Korn Shell script on Solaris to DB2 UDB LUW database

I am rather new to korn shell scripting and attempting to write a Unix script that would detach, attach a range partition table in DB2 UDB LUW database. This would be a job scheduled in control M that reads in an input file with 5 parameters passed to it from the application. I don't have much... (1 Reply)
Discussion started by: tjhanso
1 Replies

4. Shell Programming and Scripting

Korn Shell Script

I have to solve some exercises in Korn Shell, but i'm having some problems. For example: Write a korn shell script with an alfanumeric string as argument. The script lists the file's names in the current directory that contain the given string as substring and that can be read and written. I... (3 Replies)
Discussion started by: burm
3 Replies

5. UNIX for Dummies Questions & Answers

can a korn shell script be written on HP-UNIX?

Is HP UNIX and Korn different flavours of unix? can a korn shell script be written on HP Unix? (4 Replies)
Discussion started by: soujanya_srk
4 Replies

6. UNIX for Dummies Questions & Answers

practice tests- Unix Korn Shell Scripting

Hi, I am about to take certification for "Unix Korn Shell Scripting", which is conducted by brain bench. ( http://www.brainbench.com/xml/bb/common/testcenter/taketest.xml?testId=46) The test consists of 40 single and multiple choice questions that must be answered in 60 minutes. The pass mark... (0 Replies)
Discussion started by: eswasas
0 Replies

7. UNIX for Dummies Questions & Answers

Online UNIX emulator for Korn Shell scripting

Hi, I am very new to UNIX and I wanted to know if there is any online UNIX emulator in which I can practice Korn shell scripting. I have internet access, but my machine's OS is Windows XP. I just had my UNIX fundamental class and wanted to practice some shell scripting. I am not in a position to... (1 Reply)
Discussion started by: eswasas
1 Replies

8. Shell Programming and Scripting

Unix Korn Shell Array Issue (SunOS)

Hello, I'm currently messing around with arrays for the first time in scripting (Unix Korn Shell). All I'm trying to do right now before I make things complicated is read through and print out to screen whether the read file is or is not a directory. Here is my directory: ls -l total... (5 Replies)
Discussion started by: Janus
5 Replies

9. UNIX Desktop Questions & Answers

korn shell script

hi all i am writing the korn shell script. i have a SQL script which gives me the folowing output DSA.WLG.20050713211544.20051025.20050713211544 28991 1130198400 DSA.WLG.20050713211544.20051025.20050713211544 25881 1130198400 DSA.WLG.20050711210100.20051025.20050711210100 25881 ... (3 Replies)
Discussion started by: pavan_test
3 Replies

10. UNIX for Dummies Questions & Answers

korn shell script

hello., i have 2 files.. 1 file is in this folder /home/test/ssk/DSA.WLG.20050713211544.20050710.20050713211544 (this part) other file is in this folder /home/kk/dev/DSA.WLG.20050711210100.20050710.20050711210100 ... (1 Reply)
Discussion started by: pavan_test
1 Replies
Login or Register to Ask a Question