How to : Identify the the password is encrypted or not in /etc/shadow or /etc/passwd?

Thanks
AVKlinux

There are no paswords in /etc/passwd.
The password in /etc/shadow is encrypted.

Are you asking if you can reverse the encryption and crack the password?

"I" have never seen a password in /etc/shadow file that was not encrypted.

You cant turn the encryped passwords in shadow file back into plain text.

nop.i don't want to any kind of traversing from plain text to encryptions

I just want to User account has a encrypted password or not ?

Thanks
AVKlinux

Update ,

I think , I have got the answer.

If the /etc/password has "x" in password field then that user has a encrypted password.

Thanks for support & time

AVKlinux

As stated before /etc/shadows passwords are encrypted.

1) Username: It is used when user logs in. It should be between 1 and 32 characters in length.
2) Password: An x character indicates that encrypted password is stored in /etc/shadow file.
3) User ID (UID): Each user must be assigned a user ID (UID). UID 0 (zero) is reserved for root and UIDs 1-99 are reserved for other predefined accounts. Further UID 100-999 are reserved by system for administrative and system accounts/groups.
4) Group ID (GID): The primary group ID (stored in /etc/group file)
5) User ID Info: The comment field. It allow you to add extra information about the users such as user's full name, phone number etc. This field use by finger command.
6) Home directory: The absolute path to the directory the user will be in when they log in. If this directory does not exists then users directory becomes /
7) Command/shell: The absolute path of a command or shell (/bin/bash). Typically, this is a shell. Please note that it does not have to be a shell.

Your encrpted password is not stored in /etc/passwd file. It is stored in /etc/shadow file. In the good old days there was no great problem with this general read permission. Everybody could read the encrypted passwords, but the hardware was too slow to crack a well-chosen password, and moreover, the basic assumption used to be that of a friendly user-community.

Almost, all modern Linux / UNIX line operating systems use some sort of the shadow password suite, where /etc/passwd has asterisks (*) instead of encrypted passwords, and the encrypted passwords are in /etc/shadow which is readable by the superuser only.

Ikon ,

Thanks for reply.

if password field contain "*" then its also consider as a encrypted password ?

What os are you using?

I have seen on some systems a * means an invalid password exists.

Examples
Typical records that show an invalid password for smith and guest follow: 

smith:*:100:100:8A-74(office):/home/smith:/usr/bin/sh
guest:*:200:0::/home/guest:/usr/bin/sh  

The fields are in the following order: user name, password, user ID, primary group, general (gecos) information, home directory, and initial program (login shell). The * (asterisk) in the password field indicates that the password is invalid. Each attribute is separated by a : (colon). 

If the password for smith in the previous example is changed to a valid password, the record will change to the following: 

smith:!:100:100:8A-74(office):/home/smith:/usr/bin/sh 

The ! (exclamation point) indicates that an encrypted password is stored in the /etc/security/passwd file. 

I have to check for AIX ,HPUX,SOLARIS.

I found that in HPUX , "*" means password is encrypted .

I am confuse for all other oS.

help me if u have any idea.

Thanks
AVKlinux

On my HP-UX servers I have an "*" and on my RedHat Linux it has "x". I dont know about AIX and Solaris.

Ok.

Thanks buddy for conforming for HPUX .

I will search for AIX and Solaris.

Thanks for your help.

AVklinux

That x or * means that the encrypted password has been moved from /etc/passwd to /etc/shadow. It means the password has been "shadowed", not "encrypted".