Setting a default Linux password

I have a handful of Linux users that I needed to set a default password for. In addition I wanted that password to expire as soon as they login the first time, and then ask for an updated password. Here is a quick bash command to do just that:

for i in user1 user2 user3 user4; do echo "iheartfirefly" | passwd --stdin $i ; chage -d0 $i ; done
Leave A Reply
All content licensed under the Creative Commons License