Operating System - HP-UX
1825766 Members
2079 Online
109687 Solutions
New Discussion

restrict user to go to command line

 
SOLVED
Go to solution
Asad Malik
Frequent Advisor

restrict user to go to command line

Hi
We have to give a user access to run interactively a menu based utility and once the user exists out of that utility the shell should exist and no command line be available for the user.

Any idea how to go about that.

Thanks
5 REPLIES 5
Tracey
Trusted Contributor

Re: restrict user to go to command line

At the end of the script the last line should just be the word exit. You may also want to turn off Ctrl-C capabilities so they cannot break out and still get to the command line. I do this by adding stty -isig to the beginning of their profile.
Thierry Poels_1
Honored Contributor
Solution

Re: restrict user to go to command line

hi,
on top of Tracy's tips you could also "exec" your menu; in this way the current shell is replaced by the menu, so leaving the menu equals logging out.
Saves you one process too :)

Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Brian Pyle
Frequent Advisor

Re: restrict user to go to command line

If this is a menu based utility, is it being run from an action definition through CDE. If so, you could define your action so that it runs a window type of NO_STDIO which will only run the gui, with no terminal.
Follow The Path With Heart
Felix J. Liu
Advisor

Re: restrict user to go to command line

What if you define your menu application as their login shell? This way you don't need to worry about signal trapping -- they have no shells to fall back into.

Look at /etc/profile, the very beginning and the last line. It tells you how to trap signals.

David Peacock
Frequent Advisor

Re: restrict user to go to command line

When you use "exit" in a script you should tell the parents about the Exit Status.

There are basically two exit statuses that
are important:

Zero -- everyting went as it should
Greater than zero -- there was a problem

In the menu, you should use "exit 0" at the
end to show that the exit was successful

veni, vidi, vmstat