On Thu, Aug 25, 2005 at 12:08:03PM -0700, Jeff D wrote: > Dave Ewart wrote: > >-----BEGIN PGP SIGNED MESSAGE----- > >Hash: SHA1 > > > >theal wrote: > > > >>I need to change the shell on 25+ users from /bin/false to /bin/passwd > >> > >>what is the best way to do this? Can I simply do a search and replace > >>while editing /etc/passwd? > > > > > >Technically, that's probably not the Right Way, but so long as nothing > >else is writing to /etc/passwd at the same time, it ought to be fine :-) > > > >The Right Way is something like this: > > > >for a in `grep '/bin/false' /etc/passwd| cut -f 1 -d ':'`; do usermod -s > >/bin/passwd $a; done > > > >(completely untested) > > > >Dave. > > this may be a better solution. We probably dont want to give all the > system accounts a valid shell. > > for USER in user1 user2 user3 > do > usermod -s /bin/sh $USER > done
Wouldn't #vi /etc/passwd /false cepasswd <Esc> n.n.n.n.n.... (looking out for system accounts) (as I think the OP was intending to do) be just as quick? -- David Jardine "Running Debian GNU/Linux and loving every minute of it." -L. von Sacher-M.(1835-1895) -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]