Artificial intelligent assistant

Why is /etc/shadow shortening the password that I've set with the command: useradd -p? [root@P-dude dude]# useradd -p $6$Ic2PVlwi$2nf.IRWTMy0FHrPzaCjkahfu9IIxnzxPZL7yg8SsvOdbjEpoI0G8uy7AqduYKQOn2R/rnnaalRmfPMy.a0 bwong20 [root@P-dude dude]# cat /etc/shadow | grep pswayze pswayze:nf.IRWTMy0FHrPeaCjkahfufIIxnzxPZL7yg8SsvOdbjEpoI0G8uy7AqduYKQOn2R/rnnaalRmfPMy.a0:16924:0:99999:7::: I'm not sure why the system removes the first fourteen characters from my encrypted password. The password in my `/etc/shadow` file is shorter than what I've provided as an argument to `useradd -p`

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, result in empty strings for each of them. Concatenated to the rest of the encrypted password string.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 95480168c35eaafd17905aa867bd05af