A melhor maneira é com o seguinte comando:
passwd --status username
De 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.
Então, se o segundo campo de saída for NP
, então, esse usuário não tem senha definida.