Set the minimum number of characters in the password

If your password is too short, there is a risk that your password can be easily cracked. Deciding on a minimum number of characters when setting a password reduces the risk of a password being cracked if it is too short.

Use the “security password min-length” command in global configuration mode to set the minimum number of characters in the password on Cisco devices.

Set the minimum number of characters in the password

(config)#security passwords min-length < length >

< length > : Minimum number of characters in a password

This command allows you to determine the minimum number of characters for the following passwords

  • Privilege EXEC password
  • Line password(con/aux/vty)
  • Local user database password

Sample “security passwords min-length” command

Here is a sample of how to set the minimum number of characters for a password. Set the minimum number of characters; if the number of characters is less than 8, an error will be displayed when setting the password.

R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#security passwords min-length 8
R1(config)#enable secret 1234567
% Password too short - must be at least 8 characters. Password configuration failed

Cisco Basic