系统管理指南:安全性服务

更改口令

如果 PAM 配置正确,则可以采用以下两种方法来更改 Kerberos 口令:

更改口令后,所做更改在系统中传播需要一些时间(尤其是通过大型网络传播)。此延迟可能需要几分钟到一个小时或更长时间,具体取决于系统的设置方式。如果需要在更改口令后立刻获取新的 Kerberos 票证,请首先尝试新口令。如果新口令无效,请使用旧口令重试。

通过 Kerberos V5 协议,系统管理员可以设置允许每个用户使用的口令的条件。此类条件由为每个用户设置的策略(或缺省策略)定义。有关策略的更多信息,请参见管理 Kerberos 策略

例如,假定用户 jennifer 的策略(称为 jenpol)要求口令长度至少为八个字母,并且至少由两种类型的字符混合组成。这样,kpasswd 便会拒绝尝试使用 "sloth" 作为口令。


% kpasswd

kpasswd: Changing password for jennifer@ENG.EXAMPLE.COM.

Old password:   <Jennifer types her existing password>

kpasswd: jennifer@ENG.EXAMPLE.COM's password is controlled by

the policy jenpol

which requires a minimum of 8 characters from at least 2 classes 

(the five classes are lowercase, uppercase, numbers, punctuation,

and all other characters).

New password: <Jennifer types  'sloth'>

New password (again):  <Jennifer re-types 'sloth'>

kpasswd: New password is too short.

Please choose a password which is at least 4 characters long.

在以下示例中,jennifer 使用 "slothrop49" 作为口令。由于 "slothrop49" 的长度超过八个字母,并且包含两种不同类型的字符(数字和小写字母),因此此口令符合条件。


% kpasswd

kpasswd: Changing password for jennifer@ENG.EXAMPLE.COM.

Old password:  <Jennifer types her existing password>

kpasswd: jennifer@ENG.EXAMPLE.COM's password is controlled by

the policy jenpol

which requires a minimum of 8 characters from at least 2 classes 

(the five classes are lowercase, uppercase, numbers, punctuation,

and all other characters).

New password:  <Jennifer types  'slothrop49'>

New password (again):  <Jennifer re-types 'slothrop49'>

Kerberos password changed.

示例-更改口令

在以下示例中,用户 david 使用 passwd 同时更改其 UNIX 口令和 Kerberos 口令。


% passwd

	passwd:  Changing password for david

	Enter login (NIS+) password:         <Type the current UNIX password>

	New password:                        <Type the new UNIX password>

	Re-enter password:                   <Confirm the new UNIX password>

	Old KRB5 password:                   <Type the current Kerberos password>

	New KRB5 password:                   <Type the new Kerberos password>

	Re-enter new KRB5 password:          <Confirm the new Kerberos password>

请注意,passwd 需要 UNIX 口令和 Kerberos 口令。此行为由缺省配置确定。在这种情况下,用户 david 必须使用 kpasswd 将其 Kerberos 口令设置为其他内容,如下所示。

本示例说明用户 david 如何使用 kpasswd 仅更改其 Kerberos 口令。


% kpasswd

kpasswd: Changing password for david@ENG.EXAMPLE.COM.

Old password:           <Type the current Kerberos password>

New password:           <Type the new Kerberos password>

New password (again):   <Confirm the new Kerberos password>

Kerberos password changed.

 

在本示例中,用户 david 更改了 Kerberos 主体 david/admin(非有效的 UNIX 用户)的口令。该用户必须使用 kpasswd


% kpasswd david/admin

kpasswd:  Changing password for david/admin.

Old password:           <Type the current Kerberos password>

New password:           <Type the new Kerberos password>

New password (again):   <Type the new Kerberos password>

Kerberos password changed.