Date: Fri, 12 Sep 2003 10:06:19 +0300 (EEST) From: "Artyom V. Viklenko" <artem@mipk.kharkiv.edu> To: freebsd-isp@freebsd.org Subject: Re: only one user logged per session/time Message-ID: <1174.192.168.9.37.1063350380.squirrel@www.mipk.kharkiv.edu> In-Reply-To: <20030911195243.18692.qmail@web20708.mail.yahoo.com> References: <63396.148.243.211.1.1063304771.squirrel@mail.unixmexico.com> <20030911195243.18692.qmail@web20708.mail.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 ======================================================
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1174.192.168.9.37.1063350380.squirrel>