1850502 Members
2064 Online
104054 Solutions
New Discussion

Re: User's connection

 

User's connection

Hello,

I don't believe to have explained to myself, what I want is that the users make login exclusively once against the team HP 9000, that is to say if I have defined in my system 15 bills of users, I should have then alone a (1) connection for each one of them. Total of connections (login) = 15

thank you
Orlando Oliveira
5 REPLIES 5
Roger Baptiste
Honored Contributor

Re: User's connection

hi,

if you want a user to login only once into the box at any point of time, you can do a test check in the /etc/profile :

who |grep $LOGNAME >/tmp/check.$$
if [ $? -eq 0 ]
then
echo "Sorry you are already logged in"
fi


HTH
raj
Take it easy.
Sebastien Masson
Valued Contributor

Re: User's connection

If I understand correctly, you want each user a login session and when a specific user log on the machine, he or she can't log again with an other windows.

In your /etc/profile, do a test if the user already logged into your machine

who | grep massons | cut -d " " -f 1 | uniq
Darrell Allen
Honored Contributor

Re: User's connection

Don't forget about csh users. Add an edit in /etc/csh.login for them.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Krishna Prasad
Trusted Contributor

Re: User's connection

I don't know of anything that will restrict a user to only login to the box once.

However there are somethings you can do yourself.

Find out what shell your users login into.
Then add a little script to the end of the .profile or .cshrc that checks if the user is logged in or not. If they are logoff the user.

However this can be an admin nightmare....with
old process and such. Also, is there a reason to only limit one login?

Is this what you are trying to do?
Positive Results requires Positive Thinking
Deepak Extross
Honored Contributor

Re: User's connection

I'd make a small addition to Raj's script - Instead of
who |grep $LOGNAME >/tmp/check.$$
I'd suggest
who |grep "^$LOGNAME " >/tmp/check.$$
This should work fine where you have usernames that are subsets of others, say "user", "luser" and "userman"
(Don't want "user" to be locked out just because "luser" is logged in!)