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

Kerberos 口令管理

配置 Kerberos 服务后,您即会拥有两个口令:常规 Solaris 口令和 Kerberos 口令。可以将这两个口令设置为相同,也可以不同。

口令选择建议

口令几乎可以包括能够键入的任何字符,但 Ctrl 键和回车键除外。好口令是易于记忆而其他人不容易猜到的口令。以下是一些不合适的口令示例:

一个好的口令的长度至少为八个字符。此外,口令还应包含混合字符,如大小写字母、数字和标点符号。以下是一些好的口令示例(如果未出现在本手册中):


注意 – 注意 –

请勿使用这些示例。手册中出现的口令是入侵者将首先尝试的口令。


更改口令

如果 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. 

 

授予对帐户的访问权限

如果需要授予某个用户访问权限以登录到您的帐户(以您的身份),则可以通过 Kerberos 执行此操作而不必显示您的口令,方法是将 .k5login 文件放置在起始目录中。.k5login 文件是一个列表,其中包含一个或多个与要为其授予访问权限的各用户对应的 Kerberos 主体。每个主体都必须单独占一行。

假定用户 david 在其起始目录中按如下所示保存了一个 .k5login 文件:


jennifer@ENG.EXAMPLE.COM

joe@EXAMPLE.ORG  

如果用户 jenniferjoe 在其各自的领域中已经拥有 Kerberos 票证,则此文件允许这两个用户采用 david 的身份。例如,jennifer 可以使用 david 的身份远程登录到 david 的计算机 (boston),而不必提供 david 的口令。

图 25–1 使用 .k5login 文件授予对帐户的访问权限

上文对该图进行了说明。

如果 david 的起始目录使用 Kerberos V5 协议从另一台(第三台)计算机挂载了 NFS,则 jennifer 必须具有可转发票证才能访问 david 的起始目录。有关使用可转发票证的示例,请参见创建 Kerberos 票证

如果您要通过网络登录到其他计算机,则需要在这些计算机上的 .k5login 文件中包括您自己的 Kerberos 主体。

使用 .k5login 文件比公布口令安全得多,原因如下:

使用 .k5login 文件的一种常见方法是将其放置在 root 的起始目录中,从而为列出的 Kerberos 主体提供对该计算机的 root 访问权限。此配置允许系统管理员成为本地 root,或以 root 身份远程登录,而不必公布 root 口令,并且不需要任何人通过网络键入 root 口令。

示例-使用 .k5login 文件授予对帐户的访问权限

假定 jennifer 决定以 root 身份登录到计算机 boston.example.com。由于在 boston.example.comroot 起始目录的 .k5login 文件中存在该用户的主体名称项,因此不必再次键入其口令。


% rlogin boston.example.com -l root -x

This rlogin session is using DES encryption for all data transmissions.

Last login: Thu Jun 20 16:20:50 from daffodil

SunOS Release 5.7 (GENERIC) #2: Tue Nov 14 18:09:31 EST 1998

boston[root]%