forced logout for a user based on certain condition
Posted on 2003-10-31
I want through shell programing, when the user login, if certain conditions are not true, then the user is not allowed to login and automatically logout
In dotprofile (.profile) of the particular login, I execute a small file
which contains shell commands. when the user login, the file from .profile is executed but when the conditions are false, still the system comes to dollor($) prompt of the login, thereby allowing the user to continue his work.
I have used EXIT command to automatic logout in my shell programming file. But the EXIT command only exit from that program but does not logout the user.
How to logout the user automatically when he login and certain login conditions are fail.