Just to explain the format of /etc/shadow again, and the command above.
sudo is needed because getent accesses ‘shadow’ which is root read only, others no access.
The variable $USER is you, the currently logged in user.
The output is the line from /etc/shadow related to your account:
<Username>:<encpwd>:….(other data). where <encpwd> is your encrypted password.
the format of <encpwd> is:
$#$SALT$PWD_SALTED_HASH
On Ubuntu 10.04.1, the # is ‘6’ and means a SHA-512 Hash was used.
You can test your password with:
mkpasswd -m SHA-512 <passwd> SALT (w/o ‘$’)
This should return the encrypted password, starting w/ ‘$6$’