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

Lothar Braun mail at
Mon Oct 9 00:41:53 PDT 2006

Hi James,

On Monday 09 October 2006 09:24, James Corteciano wrote:
> How to change all word lines of /bin/bash at /etc/passwd file to
> /sbin/nologin in just  a single line command?

I think you can do this with:

sed 's!/bin/bash$!/sbin/nologin!' /etc/passwd > /etc/passwd

Best regards,

More information about the freebsd-questions mailing list