Path: utzoo!attcan!uunet!aplcen!samsung!cs.utexas.edu!tut.cis.ohio-state.edu!att!cbnews!res From: res@cbnews.att.com (Robert E. Stampfli) Newsgroups: comp.unix.wizards Subject: Re: time dependent login Message-ID: <1990May31.172936.10030@cbnews.att.com> Date: 31 May 90 17:29:36 GMT References: <979@sixhub.UUCP> <1990May28.200520.20288@cbnews.att.com> <1990May29.194446.12623@cbnewsh.att.com> Distribution: na Organization: AT&T Bell Laboratories Lines: 18 > I want to enable login to a certain userid only during certain times. >Assume that cron can run a program to enable or disable, and that I can >do this as root if need be. Given that, is there an elegant way to >enable a login only during certain times, and to do so in a way which >doesn't lead to possible timing problems or other system uglyness, such >as editing the password file directly? Why *not* modify the password file? To turn an account "xyz" off: /bin/echo '/^xyz:/s/:/:NOLOG/\nw' | /bin/ed /etc/passwd To turn it back on: echo '/^xyz:/s/:NOLOG/:/\nw' | /bin/ed /etc/passwd -- Rob Stampfli / att.com!stampfli (uucp@work) / kd8wk@w8cqk (packet radio) 614-864-9377 / osu-cis.cis.ohio-state.edu!kd8wk!res (uucp@home)