Operating System - HP-UX
1834013 Members
2406 Online
110063 Solutions
New Discussion

preventing users from escaping to shell (!sh)

 
Zam_1
New Member

preventing users from escaping to shell (!sh)

How I can prevent users not to access shell when they are in Menus.

Thanks
Zam
6 REPLIES 6
Sanjay Kumar Suri
Honored Contributor

Re: preventing users from escaping to shell (!sh)

Change the Shell to

/usr/bin/false

for the user.

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Michael Schulte zur Sur
Honored Contributor

Re: preventing users from escaping to shell (!sh)

Hi,

what menu?

Michael
Eugene Klaus
Frequent Advisor

Re: preventing users from escaping to shell (!sh)

In the .profile for the user enter
trap "exit" 1 2 3 15
I have promises to keep and miles to go before I sleep and miles to go before I sleep
Steve Steel
Honored Contributor

Re: preventing users from escaping to shell (!sh)

Hi


Since you can escape in may ways put in /etc/profile


export SHELL=not_allowed


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
RAC_1
Honored Contributor

Re: preventing users from escaping to shell (!sh)

Perhaps you want users not to do a control C and get to the prompt while they are on menu. (some script that gives this)

You need to put in user's .profile file the following.

trap "" 1 2 3

This will ignore signals 1 2 3 (HUP, INT and QUIT)

Anil
There is no substitute to HARDWORK
Jose Mosquera
Honored Contributor

Re: preventing users from escaping to shell (!sh)

Hi,


In the .profile user's file:

trap "" 1 2 3
your menu call...
exit

Rgds.