Command is as below, which is executed on wind river linux manchine.
useradd vpatest -c Pav -g guest -G log -s /data/bin/cli.sh -p $6$cem^CM38$4YdQAPgu8EXNG3ecurYk4eN1sIiYNauBdHFRJew3l/Xa8PyOjACD1xNDhoocVwBzBUN9BlTXXJ/oiWHwV.fhL1
In the /etc/shadow
file it is writing only
YdQAPgu8EXNG3ecurYk4eN1sIiYNauBdHFRJew3l/Xa8PyOjACD1xNDhoocVwBzBUN9BlTXXJ/oiWHwV.fhL1
and truncating $6$cem^CM38$4
Any way to avoid this and write the full password? I will get encrypted password and need to write as it is in the shadow file. Otherwise, is any other utilities that can be used?
''
?$6
and$4
are positional parameters, and$cem
is a valid variable, so they'll be expanded by the shell. Though^
isn't a valid part of a variable name, so I can't see why the^CM38
part would disappear. Put the string in single quotes to prevent the parameter expansion.