Hot answers tagged


Because $ is a special character to the shell you should put the password in between single quotes: useradd -p '$6$Ic2PVlwi$2nf.IRWTMy0FHrPza6mh5wjomwbYtIIxnzxPZL7yg8SsvOdbjEpoI0G8uy7AqduYKQOn2R/rnnaalRmfPMy.a0' bwong20 without these the shell will try to expand $6, $Ic2PVlwi and $2 to their respective variable values, and as the variables are not set, ...


You can to do it using passwd's -e option after creating the account. useradd has -e option for expiring a user account, not password. From man passwd: -e, --expire Immediately expire an account's password. This in effect can force a user to change his/her password at the user's next login.

Only top voted, non community-wiki answers of a minimum length are eligible