Re: only one user logged per session/time

From: Artyom V. Viklenko (artem_at_mipk.kharkiv.edu)
Date: 09/12/03

  • Next message: Marcus Reid: "Re: Anti Virus for mail server"
    Date: Fri, 12 Sep 2003 10:06:19 +0300 (EEST)
    To: freebsd-isp@freebsd.org
    
    

    Something similar can be placed into system-wide profiles such as
    /etc/profile or /etc/csh.login. So, there will be no need to read passwd
    file and NIS-aware systems will work fine. And it will be transparent
    in terms of creating new users - no need separate login class.
    Also, there is no problem with rewritting environment variables (which
    some times can be set "readonly" due to security considerations).

    Lanny Godsey wrote:
    >
    > This isn't exactly what you want, but you may want to look at
    > /etc/login.conf and limit the # of processes, memory, and files a user
    > may have open.
    >
    > add the following to /etc/login.conf, then run cap_mkdb /etc/login.conf
    >
    > onelogin:\
    > :tc=default:\
    > :shell=/usr/local/bin/onelogin:
    >
    >
    > place the following into /usr/local/bin/onelogin
    > ------------------------------------------------------
    > #!/bin/sh
    > # set the limit here.
    > CNT=1
    > MYUID=`id -u`
    > DEVS=`find /dev -user $MYUID | wc -l`
    > if [ $DEVS -gt $CNT ]; then
    > echo Sorry, this system has limited you to only $CNT simultanious
    > connections.
    > exit
    > fi
    > # read users shell from passwd (this won't work with nis)
    > MYSHELL=`grep ^$USER: /etc/passwd | cut -d : -f 7`
    > # some /bin/sh variants may not allow to write to $SHELL
    > SHELL=$MYSHELL
    > # set the shell you want here
    > exec $MYSHELL
    >
    > -----------------------------------------------------------------
    >

    -- 
           Sincerely yours,
                             Artyom V. Viklenko.
    ======================================================
    System Administrator            artem@mipk.kharkiv.edu
    ------------------------------------------------------
    IIAT NTU "KhPI" 21, Frunze Str., Kharkov Ukraine 61002
    Phone: +380 (572) 400026        Fax: +380 (572) 474062
    ======================================================
    _______________________________________________
    freebsd-isp@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-isp
    To unsubscribe, send any mail to "freebsd-isp-unsubscribe@freebsd.org"
    

  • Next message: Marcus Reid: "Re: Anti Virus for mail server"