Change default shell for several users

chsh is great when you need to change default login shell for a lot of users.
Something like:

for f in $(grep home /etc/passwd | grep -v ftp | cut -d':' -f1) ; do
chsh -s /bin/sh $f ; 
done

You would of course have to refine the grep line to sort out accounts you don’t want to change default login shell for .

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>