Computing.Net > Forums > Unix > Restrict cd between unix directorie

Restrict cd between unix directorie

Reply to Message Icon

Original Message
Name: hismail
Date: November 21, 2006 at 04:43:48 Pacific
Subject: Restrict cd between unix directorie
OS: Sun 5.9
CPU/Ram: 2 gig/4gig
Model/Manufacturer: Solaris/Sparc
Comment:

Hi

using /bin/ksh & /bin/sh
I would like to know how can I restrict users from moving between directories.
Also before the TERM is set the user ctrl-C & breaks out of the shell -How can i restrict this from hapenning.

Thanks
Hamim


Report Offensive Message For Removal


Response Number 1
Name: nails
Date: November 21, 2006 at 10:56:50 Pacific
Subject: Restrict cd between unix directorie
Reply: (edit)

Question 1: have you considered using a restricted shell like: rksh

Question 2: I have a script called disable_interrupts that I use in ksh:

# disable_interrupts:
trap "exit 1" 1 2 3 9 15 16 17

if [[ -o interactive ]]
then
stty -isig
stty intr ''
stty quit ''
stty erase '^H'
stty kill ''
stty eof ''
stty eol ''
stty eol2 ''
stty swtch ''
stty start ''
stty stop ''
stty susp ''
stty dsusp ''
stty rprnt ''
stty flush ''
stty werase ''
stty lnext ''
fi
# end disable_interrupts

Perform any changes you need to, and then call the enable_interrupts script:

# /opt/logins/bin/enable_interrupts

stty sane
stty istrip
stty erase '^h'
stty quit '^\'
stty susp '^z'
stty intr '^c'

trap 1 2 3 9 15 16 17
# end enable_interrupts


Just what interrupts you choose to manipulate will depend on your unix version. The above is for Solaris 7. Use at your own risk.


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Restrict cd between unix directorie

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software