Setting and changing minimum password length

The configurable password allows you to customize passwords to fit your needs such as using four-digit personal identification numbers (PINs) or anonymous logins with NULL passwords.

NoteAdaptive Server uses a default value of 6 for minimum password length. Sybase recommends that you use a value of 6 or more for this parameter.

The system security officer can specify:

The per-login or per-role value overrides the server-wide value. Setting minimum password length affects only new passwords created after setting the value.

StepsSetting minimum password length for a specific login

  1. To set the minimum password length for a specific login at creation, use sp_addlogin.

    This example creates the new login “joe” with the password “Djdiek3”, and sets the minimum password length for “joe” to 8:

    sp_addlogin joe, "Djdiek3", @minpwdlen=8
    

    For details on the syntax and rules for using minimum password length, see sp_addlogin in the Reference Manual: Procedures.

StepsSetting minimum password length for a specific role

  1. To set the minimum password length for a specific role at creation, use create role.

    This example creates the new role intern_role with the password “temp244” and sets minimum password length for intern_role to 0:

    create role intern_role with passwd "temp244", min passwd length 0
    

    The original password is seven characters, but the password can be changed to one of any length because minimum password length is set to 0.

    See create role in the Reference Manual: Commands.

StepsChanging minimum password length for a specific login

  1. Use sp_modifylogin to set or change minimum password length for an existing login. sp_modifylogin effects only user roles, not system roles.

    Example 1 Changes minimum password length for the login “joe” to 8 characters.

    sp_modifylogin "joe", @option="min passwd length", @value="8"
    

    NoteThe value parameter is a character datatype; therefore, quotes are required for numeric values.

    Example 2 Changes the value of the overrides for minimum password length for all logins to eight characters.

    sp_modifylogin "all overrides", @option="min passwd length", @value="8"
    

    Example 3 Removes the overrides for the minimum password length for all logins.

    sp_modifylogin "all overrides", "min passwd length", @value="-2"
    

    See sp_modifylogin in the Reference Manual: Procedures.

StepsChanging minimum password length for a specific role

  1. Use alter role to set or change minimum password length for an existing role.

    Example 1 Sets the minimum length for physician_role, an existing role, to 5 characters:

    alter role physician_role set min passwd length 5
    

    Example 2 Overrides the minimum password length for all roles:

    alter role "all overrides" set min passwd length -1
    

See alter role in the Reference Manual: Commands.