INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

CMS

CMS User login session limit by aphophas
Posted: 19 Nov 08 (Edited 5 Dec 08)

I noticed in another thread "thread690-1251570: CMS logins/CentreVu 13.0: CMS logins/CentreVu 13.0: CMS logins/CentreVu 13.0" there was some info shared about this topic. I have been using something on my CMS for sometime, and works beautifully. Just replace the "/usr/bin/cms" with the new "/usr/bin/something" replacement


******** START OF SCRIPT **********

CODE


LOGINTAB="/etc/logins.table"

LOGINMAX=`grep '^[      ]*'$LOGNAME $LOGINTAB | tr -s "\011" " " | \

          cut -f2 -d' '`

[ -z "${LOGINMAX}" ] && LOGINMAX=8

TTY=`ps -p $$ | grep -v PID | tr -s "\011" " " | cut -f3 -d' '`

echo "You are logging in at line $TTY ..."

LOGINDEV=`/usr/bin/w | grep \^$LOGNAME | grep -v $TTY | \

          tr -s "\011" " " | \

          cut -f2 -d' ' | tr -s "\012" " "`

if [ $LOGINMAX -ne 0 ]

   then

         LOGINCNT=`echo $LOGINDEV | wc -w 2> /dev/null`

         LOGINCNT=`expr ${LOGINCNT:-0} + 0`

echo "Total number of sessions loggedin $LOGINCNT"

         if [ $LOGINCNT -gt $LOGINMAX ]
            then
echo $LOGINCNT
#                  /usr/ucb/logger -p daemon.notice -t PROFILE \

#      "Denied login - user <$LOGNAME> - lines $TTY and $LOGINDEV"

                  echo "You are already logged in [$LOGINDEV] ..."

                  sleep 3

                  kill -KILL $$

            fi

   fi



/usr/bin/cms
********** END OF SCRIPT **********

The line "[ -z "${LOGINMAX}" ] && LOGINMAX=8" controls the amount of logins per user. This particular one is set for 8 sessions for the user that has this applied to their account. Just tweak the number to the amount you want, then save the file.

Just create the new file in "/usr/bin/something", then chmod to 755. Apply the new file either by editing the "/etc/passwd" file or through the GUI using "admintool". Of course depending on your preference, and version of Solaris.
 

Back to Avaya: CM/Aura (Definity) FAQ Index
Back to Avaya: CM/Aura (Definity) Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close