I want to change the password of one user called testuser. when i am selecting this password (R0na!do8) , chpassword is showing some error, but if i use passwd command then it is working fine .
I want to change this user password through chpasswd command & i want to specify this password only . Any idea how to resolve it??
[root@xxxxx02 ~]# echo "testuser:R0na!do8"|chpasswd
-bash: !do8": event not found
The exclamation mark will cause command history expansion.
You need to use single quotes: e.g.: echo 'testuser:R0na!do8'|chpasswd
For explanation: http://www.gnu.org/software/bash/manual/bashref.html#Quoting