Operating System - HP-UX
1833695 Members
3522 Online
110062 Solutions
New Discussion

Re: Restricting acces to users

 
SOLVED
Go to solution
Scott Dunkley
Regular Advisor

Restricting acces to users

When a user logs on I want them only to be able to start SQLPLUS and what ever they do ie CTRL-C, logout, I dont want them to get bacxk to a shell prompt, just log them straight out, I seem to remember using trap 1 2 3 in the .profile but cant remeber the rest of the syntax, can anyone help ????
Better to regret something you have done, than something you havn't
6 REPLIES 6
James R. Ferguson
Acclaimed Contributor

Re: Restricting acces to users

Scott:

At the end of the profile place "exec your_script_name".

Upon exiting "your_script_name" the user will be logged-off.

...JRF...
John Palmer
Honored Contributor

Re: Restricting acces to users

If this is Oracle, could they use Oracle Client, connect via SQL*NET and therefore not need to log in to UNIX at all?

If that is not suitable, try exec'ing sqlplus in their .profile. This will ensure that they don't have a shell to return to.

E.g. at end of .profile:-

set up environment...
exec sqlplus

Regards,

John
Cheryl Griffin
Honored Contributor

Re: Restricting acces to users

Add the exec command to the .profile for the user:

exec {application_here}


When they exit the application, they will be logged out automatically.
"Downtime is a Crime."
Stefan Farrelly
Honored Contributor
Solution

Re: Restricting acces to users


doing an exec at the end of your .profile is a good idea but if a user logs in and keeps pressing CTRL-C before the .profile runs the exec then they will drop out to a shell.
Insert this into the .profile as the first line;

trap "echo error; exit 1" 1 2 3 4 5 6

that way if a user hits CTRL-C before the exec is run they will be logged out after seeing the word error displayed
Im from Palmerston North, New Zealand, but somehow ended up in London...
Scott Dunkley
Regular Advisor

Re: Restricting acces to users

Thanks for all your help, its not letting me assign points but they are all valid replies and it works a treat!!!!
Better to regret something you have done, than something you havn't
James R. Ferguson
Acclaimed Contributor

Re: Restricting acces to users

Scott:

If you can't assign points, contact the ITRC with the problem. Thanks!!!