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

James Corteciano freebsd at
Mon Oct 9 02:18:45 PDT 2006

Dear guru's,

Thanks all you guys for the great response. Now, I've done it using
text-editor of NANO and there is Find, and To Replace section which makes
big help to replacing the whole word.

Best regards,

James Corteciano
FreeBSD User

On 10/9/06, Lothar Braun <mail at> wrote:
> 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

James G. Corteciano
FreeBSD User

More information about the freebsd-questions mailing list