How to tell if the password is set

password

I have been using this server for a few months. At the beginning I sent the admin my public ssh key, and he set up the account for me, and I have only used the ssh key to log in. I definitely didn't have a password at first.

Since then I may or may not have set up a password using passwd. Right now if I use passwd I see this.

$ passwd
Changing password for user myusername.
Changing password for myusername.
(current) UNIX password:

While it seems to suggest that I do have a password, I have no memory of ever doing this.

How can I tell conclusively whether my password is set?

EDIT:
I can't log in nor change password, because I don't know what the password is (blank password doesn't work).
The distro is Fedora release 20 (Heisenbug).

Best Answer

The best way is with the following command:

passwd --status username

From man passwd:

Display account status information. The status information consists of 7 fields. The first field is the user's login name. The second field indicates if the user account has a locked password (L), has no password (NP), or has a usable password (P). The third field gives the date of the last password change. The next four fields are the minimum age, maximum age, warning period, and inactivity period for the password. These ages are expressed in days.

So, if the second output field is NP, then, that user has no password set.

Related Question