I typed the passwd command, then input the new password.
~$ sudo passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
I closed this terminal and open a new one. When I was prompted to input password again, the new password was not accepted, instead the old one was accepted.
$ sudo apt
[sudo] password for user:
Sorry, try again.
[sudo] password for user:
apt 1.2.24 (amd64)
Usage: apt [options] command
...
What did I do wrong? How can I view my current password?