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

pbdlists at pinboard.com pbdlists at pinboard.com
Mon Oct 9 00:50:05 PDT 2006


sed -i .backup "s,:/bin/bash$,:/sbin/nologin," /etc/passwd 

But at least on my FBSD systems bash is in /usr/local/bin/bash, not
/bin/bash! And what would you need this for?

Cheers,

Kurt

On Mon, Oct 09, 2006 at 03:24:30PM +0800, James Corteciano wrote:
> Dear guru's:
> 
> How to change all word lines of /bin/bash at /etc/passwd file to
> /sbin/nologin in just  a single line command?
> 
> I am looking forward for your great responses.
> 
> Thank you.
> 
> Regards,
> 
> -- 
> James G. Corteciano
> FreeBSD User
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"


More information about the freebsd-questions mailing list