How to change all /bin/bash at /etc/passwd to /sbin/nologin?

Lothar Braun mail at
Mon Oct 9 01:46:04 PDT 2006

On Monday 09 October 2006 10:03, Matthias Apitz wrote:
> > sed 's!/bin/bash$!/sbin/nologin!' /etc/passwd > /etc/passwd
> DONT DO THAT this way. The result would be that your actual
> shell truncates the file '/etc/passwd' to zero length and
> then launches the 'sed'.

Damn. I just built the regexp but didn't check what the command does before i 
sent it to the list. Sorry for that. I hope nobody killed his pw-file because 
of my advice :/

-- Lothar

More information about the freebsd-questions mailing list