# Password length question

## stealthy

Hello Everyone,

I am trying to configure my system, so that the minimum password length is 8

I tried editing /etc/login.defs and change PASS_MIN_LEN

but that gives me the error

```
configuration error - unknown item 'PASS_MIN_LEN' (notify administrator)
```

Although it seems to do what I intended to do.

Just wondering if there is another way of defining complex passwords..or if I need to do something different, so that I don't get this error.

Any help would be greatly appreciated.

Thanks,

----------

## khayyam

 *stealthy wrote:*   

> Just wondering if there is another way of defining complex passwords..or if I need to do something different, so that I don't get this error.

 

stealthy ... assuming you are using pam this is defined in /etc/pam.d/system-auth

```
password  required  pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3
```

... so, a minimum length of 8 chars is already set, and should be enforced by 'passwd' (see: /etc/pam.d/passwd).

HTH & best ... khay

----------

## stealthy

Hello Khayyam,

My /etc/pam.d/system-auth is exactly the way you mentioned.

my /etc/pam.d/passwd has

```

auth       sufficient   pam_rootok.so

auth       include      system-auth

account    include      system-auth

password   include      system-auth

```

What do I need to change in there, so that password policy is enforced. Right now as a regular user, I can still setup a password that is 7 characters long.

----------

## khayyam

 *stealthy wrote:*   

> What do I need to change in there, so that password policy is enforced. Right now as a regular user, I can still setup a password that is 7 characters long.

 

stealthy ... I'm not sure what's going on here because as I understand the above system-auth should enforce a minimum length. The 7 char passphrase this was created by root? Can the user do the same and still login?

best ... khay

----------

