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

James Corteciano freebsd at gascort.com
Mon Oct 9 01:31:10 PDT 2006


Hi Lothar,

Thanks for your response. How about if all uid's that >=500 at passwd file
must change from /bin/bash to /sbin/nologin?

Thank you.

Best regards,

James C.
FreeBSD User


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



-- 
James G. Corteciano
FreeBSD User


More information about the freebsd-questions mailing list