Discussion Locked

To Lock/Disconnect Sun User

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

We have Sun Server and Bay router and the accounting file is upload to a web page form there a customer could see his log in/log out time and bill status.I want to know how do i
1.Disconnect current logged in user.
2.How do i inform users that are running below credit that you have been locked when they try to connect.e.g. user abc has a balance of -350 and when he try to connect to internet ,went on verifying user name and password and there he got a prompt"You have been lock due to negative balance"

7 replies

by ulairi

On the system, do a "who -u" - this will show you something like this:
ulairi console Aug 22 19:50 2:31 7861 (:0)
ulairi pts/3 Aug 22 19:51 0:01 9593 (:0.0)

The last number (7861 and 9593) is the PID for the users' login shell. Send a kill to it (via "kill pid") and you'll have logged the user off.

As for a custom message - I'd recommed writing a shell script that queries the users' status and displays the number of credits they are under, and does an "exit" call.

For an example of what I mean, take a look at /bin/false

This discussion is closed to new replies.