I have changed your script like that:
Add this to .profile
ALLOWEDLOGINCOUNT=1
if test "$LOGNAME" != "root"
then
CURRENTLOGINCOUNT=`who | grep ${LOGNAME} |wc -l`
echo CURRENT logged in user including this session:
${CURRENTLOGINCOUNT}
echo ALLOWED login count: ${ALLOWEDLO
The method we use is to add some "special sauce" to the users .profile file.
The following code works for ksh:
if test "$LOGNAME" != "special"
then
set -- `who | grep -v "\`who am i\`" | grep "^$LOG "`
[ -n "$*" ] && abort "$1 is already logged on at $2"
fi
where "special" is the name of a user
> Thanks to the advanced resource management tools on
> OpenSolaris this is
> actually possible:
> http://blogs.sun.com/darren/entry/limiting_users_to_on
> e_login
Ahhh, I've done this before! But back then, it was just playing around.
That particular approach requires unorthodox thinking, I'll
UNIX admin wrote:
> Not that I know of. But this goes against the very principles on which UNIX
> was built, namely, an OS which can be used by different people, working on
> physical and virtual terminals, all at the same time.
I disagree, it goes very much with the resource management princip
Omer Faruk Sen wrote:
> Hi,
>
> Is it possible to limit users to login just one at a time?
>
> I mean user X can login from anywhere (ssh,telnet,X) but when he is
> logged in any other attempt to login with the username X is prohibited
> and maybe
> printed out a message like "This user is alre
>
> Hi,Is it possible to limit users to login
> just one at a time?I mean user X can login
> from anywhere (ssh,telnet,X) but when he is logged in
> any other attempt to login with the username X is
> prohibited and maybe
> printed out a message like "This user is
> already logged in"?Best
> Regar
Hi,
Is it possible to limit users to login just one at a time?
I mean user X can login from anywhere (ssh,telnet,X) but when he is logged
in any other attempt to login with the username X is prohibited and maybe
printed out a message like "This user is already logged in"?
Best Regards.
_