コマンドを実行するごとにユーザー名とパスワードが必要になります。
CLI には、管理者のホームディレクトリの資格情報ファイルにユーザー名とパスワードのペアを保存できるログインコマンドがあります。このファイル .apocpass は、アクセスが制限されています。login コマンドが実行されると、CLI は apocpass ファイルがホームディレクトリに存在するかどうかをチェックします。このファイルは存在するが、このファイルに正しいアクセス権 (600) が設定されていない場合は、コマンドはエラーを表示して終了します。ユーザー名を指定した場合は、パスワードの入力を求めるメッセージが表示されます。ユーザー名を指定しなかった場合は、ユーザー名とパスワードの入力を求めるメッセージが表示されます。このユーザー名とパスワードの認証は、匿名アクセスを使用して行われます。匿名アクセスがサポートされていない場合は、承認済みの DN とパスワードの入力を求めるメッセージが表示されます。認証が正常に完了すると、.apocpass ファイルにエントリが追加されます。このエントリの鍵は、サーバー / ポート / ベース DN 情報とユーザー名から作成されます。
たとえば、ユーザー “jmonroe” は、ポート 389 上のベースエントリ o apoc を持つサーバー cdelab1.ireland.sun.com のパスワードを、鍵 cdelab1.ireland.sun.com:389;o=apoc:jmonroe を使用して保存できます。保存される値は、ユーザー DN とパスワードです。この方法を採用することで、このバックエンドを利用する多数のユーザーのユーザー名とパスワードのペアを保存できます。同様に、ほかのバックエンドについてもユーザー名とパスワードのペアを保存できます。ログインコマンドが正常に完了すると、ユーザー名またはパスワードを指定することなくほかの CLI コマンドを実行できます。
ほかのコマンドについては、CLI はまずそのユーザー用の .apocpass ファイルが存在するかどうかをチェックします。このファイルが存在しないと、ユーザー名とパスワードの入力を求めるメッセージが表示されます。このユーザー名とパスワードの認証が正常に完了すると、コマンドが実行されます。資格情報ファイルが存在し、かつコマンド行にユーザー名が指定された場合、CLI はこのホスト、ポート、ベース DN、およびユーザー名のエントリを検索します。エントリが存在すると、保存されているユーザー DN とパスワードが使用されてコマンドが実行されます。エントリが存在しないと、パスワードの入力を求めるメッセージが表示されます。コマンド行でユーザー名が指定されないと、.apocpass ファイルが検索され、ホスト / ポートとベース DN のペアを使用した鍵の確認が行われます。このペアが一意のエントリとして存在する場合、保存されているユーザー DN とパスワードが使用されてコマンドが実行されます。エントリが一意でない場合、ユーザー名の入力を求めるメッセージが表示されます。これがエントリと一致すると、保存されているユーザー DN とパスワードが使用されてコマンドが実行されます。これが一致しないと、パスワードの入力を求めるメッセージが表示されます。パスワードの入力を求めるメッセージがユーザーに表示される場合は、.apocpass ファイル内の、このホスト / ポートとベース DN のペアのエントリが使用されてユーザー名とパスワードの認証が行われます。そのようなエントリが存在しない場合には、匿名アクセスが使用されて認証が行われます。