Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deny users access to $

Status
Not open for further replies.
Apr 28, 2003
122
US
Most users are set to launch an application at login and disconnect when they exit the app for 3 months now. Recently users sporadically have exited to the $ prompt instead of disconnecting. The following lines are in .profile for each user:

. /usr/dec/START.CMD # Start App
exit # Disconnect after App exit

What could be the cause of the exit command being bypassed other than user keystrokes? Is there a way to block user keystrokes from exiting the script? Would using logout instead of exit make a difference? A response to any of these three would be greatly appreciated.


Thanks in advance

[morning] needcoffee
 
Why r u using "exit" in .profile.

Write "logout" in the end of /usr/dec/START.CMD .

Also do one thing insert the undermentioned lines , this will also logout user when he/she will press "^C". Just change the variable name i,e "ANS" with ur's. To write "^C" use "Control v and then without releasing Control press c".

if [ $ANS = '^C' ]
then
logout
fi

Best Regards,
vivek
 
Check the /etc/profile . There the trap statement in the begining and the end of the file. The trap statement is there so that other users can not press Ctrl C to just go to the prompt to get root access. You can use the trap statement in your .profile so that the user can not exit out of the program.
 
There are 2 good ways to stop them getting to the shell prompt.

Either change the call to
exec /usr/dec/START.CMD

or better still, if possible

modify the /etc/password and change the shell from /usr/bin/ksh to /usr/dec/START.CMD

Both will ensure that they cannot exit to a shell prompt from START.CMD since there will be no shell process to exit to.

Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top