Name

pdbedit — SAM データベース (Samba ユーザのデータベース) を管理する

Synopsis

pdbedit [-L] [-v] [-w] [-u username] [-f fullname] [-h homedir] [-D drive] [-S script] [-p profile] [-K] [-a] [-t, --password-from-stdin] [-m] [-r] [-x] [-i passdb-backend] [-e passdb-backend] [-b passdb-backend] [-g] [-d debuglevel] [-s configfile] [-P account-policy] [-C value] [-c account-control] [-y]

説明

このツールは、samba(7) システムの一部である。

pdbedit プログラムは SAM データベース内に保持されるユーザアカウントを管理するために利用され、 root だけが実行できる。

pdbedit ツールは、 passdb モジュールのインターフェイス経由で操作を行なうことで、 実際に利用するユーザーデータベースの種類 (現在のところ、smbpasswd ファイル、LDAP、NIS+、tdb ベースのデータベースがあり、それ以外のものもツールの変更なしに追加が可能) に依存しない作りになっている。

pdbedit の主な利用方法として、 ユーザーアカウントの追加、 ユーザーアカウントの削除、 ユーザーアカウントの変更、 ユーザーアカウントの一覧表示、 ユーザーアカウントの取り込みの 5 種類がある。

オプション

-L

データベースのすべてのユーザーアカウントを一覧表示する。 ユーザー名と UID の組み合わせが「:」で区切られて一覧表示される。

例: pdbedit -L

sorce:500:Simo Sorce
samba:45:Test User
-v

冗長な一覧表示形式を有効にする。 データベース内のユーザーを一覧表示する際には、 アカウントの各項目を詳細に表示する。

例: pdbedit -L -v

---------------
username:       sorce
user ID/Group:  500/500
user RID/GRID:  2000/2001
Full Name:      Simo Sorce
Home Directory: \\BERSERKER\sorce
HomeDir Drive:  H:
Logon Script:   \\BERSERKER\netlogon\sorce.bat
Profile Path:   \\BERSERKER\profile
---------------
username:       samba
user ID/Group:  45/45
user RID/GRID:  1090/1091
Full Name:      Test User
Home Directory: \\BERSERKER\samba
HomeDir Drive:  
Logon Script:   
Profile Path:   \\BERSERKER\profile
-w

一覧表示を「smbpasswd」形式にする。 データベース内のユーザを一覧表示する際、 アカウントの各項目は smbpasswd ファイル互換の形式 (詳細は smbpasswd(5) を参照のこと) で表示される。

例: pdbedit -L -w

sorce:500:508818B733CE64BEAAD3B435B51404EE:
          D2A2418EFC466A8A0F6B1DBB5C3DB80C:
          [UX         ]:LCT-00000000:
samba:45:0F2B255F7B67A7A9AAD3B435B51404EE:
          BC281CE3F53B6A5146629CD4751D3490:
          [UX         ]:LCT-3BFA1E8D:
-u username

操作 (表示・追加・削除など) の対象とするユーザ名を指定する。 追加・削除・変更操作においては必須であり、 表示操作においては任意である。

-f fullname

ユーザの追加および変更を行なう際に、 ユーザのフルネームを指定する。

例: -f "Simo Sorce"

-h homedir

ユーザの追加および変更を行なう際に、 ユーザのホームディレクトリとなるネットワークパスを指定する。

例: -h "\\\\BERSERKER\\sorce"

-D drive

ユーザの追加および変更を行なう際に、 ホームディレクトリの割り当て先とする Windows のドライブ名を指定する。

例: -D "H:"

-S script

ユーザの追加および変更を行なう際に、 ユーザのログオンスクリプトのパスを指定する。

例: -S "\\\\BERSERKER\\netlogon\\sorce.bat"

-p profile

ユーザの追加および変更を行なう際に、 ユーザのプロファイルパスを指定する。

例: -p "\\\\BERSERKER\\netlogon"

-G SID|rid

ユーザの追加および変更を行なう際に、 ユーザのプライマリグループの SID (セキュリティ識別子) または RID を指定する。

例: -G S-1-5-21-2447931902-1787058256-3961074038-1201

-U SID|rid

ユーザの追加および変更を行なう際に、 ユーザの SID (セキュリティ識別子) または RID を指定する。

例: -U S-1-5-21-2447931902-1787058256-3961074038-5004

-c account-control

ユーザの追加および変更を行なう際に、 ユーザのアカウント制御プロパティを指定する。 指定可能なフラグを以下に示す:

  • N: パスワード不要

  • D: アカウント無効

  • H: ホームディレクトリ必須

  • T: 一時的に他のアカウントと重複

  • U: 通常のユーザアカウント

  • M: MNS ログオン用のユーザアカウント

  • W: コンピュータ信頼アカウント(訳注: ドメインに参加する各マシンのためのアカウント)

  • S: サーバ信頼アカウント

  • L: 自動ロック

  • X: 無期限パスワード

  • I: ドメイン信頼アカウント(訳注: 信頼関係するドメインのためのアカウント)

例: -c "[X ]"

-K|--kickoff-time

このオプションは特定のユーザに対してkickoff時間を 変更するために使われる。kickoff時間を無制限にする引数は、 "決して指定してはならない"。

例: pdbedit -K never user

-a

ユーザをデータベースに追加する際に指定する。 ユーザ名を -u オプションで指定する必要がある。 ユーザを追加する際、 pdbedit はユーザのパスワードの入力を求める。

例: pdbedit -a -u sorce

new password:
retype new password

Note

unix password sync が設定されていた場合でも、 pdbedit はスクリプトを実行せず、Samba のユーザデータベース内のデータのみを更新する点に注意。

ユーザの追加と同時にパスワード同期を直ちに行ないたい場合は、 smbpasswd-a オプションを使用すること。

-t, --password-from-stdin

パスワードを (passwd(1) プログラムのように) /dev/tty から読み取る代わりに標準入力から読み取らせる。 パスワードは二度入力し、各々末尾に改行(newline)文字を付けること。

-r

データベースの既存のユーザの情報を変更する際に指定する。 ユーザ名は -u オプションで指定する必要がある。 これ以外のオプションは、 指定したユーザのプロパティを変更するために用いられる。 このオプションは過去との互換性を保つために残されているだけで、 現在は指定する必要はない。

-m

このオプションは -a オプションと組み合わせて利用する。 これにより、 pdbedit はユーザーアカウントではなくコンピュータ信頼アカウントを追加する。 (-u username にはコンピュータ名を指定する)

例: pdbedit -a -m -u w2k-wks

-x

データベースからユーザを削除する際に指定する。 ユーザ名は -u オプションで指定する必要がある。

例: pdbedit -x -u bob

-i passdb-backend

ユーザ情報の取得元となるパスワードデータベースとして、 smb.conf で指定したものとは別のものを指定する。 これは、ローカルのユーザデータベースにデータを取り込む (インポートする) 際に利用する。

このオプションにより、 パスワードデータベースの移行を容易に行うことができる。

例: pdbedit -i smbpasswd:/etc/smbpasswd.old

-e passdb-backend

指定したパスワードデータベースに存在するすべてのユーザを転送 (エクスポート) する。

このオプションにより、 パスワードデータベースの移行とバックアップを容易に行うことが可能となる。

例: pdbedit -e smbpasswd:/root/samba-users.backup

-g

-g オプションを指定すると、 -i in-backend -e out-backend オプションはユーザーデータベースではなく、 グループマッピングに対して適用される。

このオプションにより、 パスワードデータベースの移行とバックアップを容易に行うことが可能となる。

-b passdb-backend

デフォルト以外のパスワードデータベースを指定する。

例: pdbedit -b xml:/root/pdb-backup.xml -l

-P account-policy

アカウントポリシーを表示する。

有効なポリシーは、 「minimum password age」、「reset count minutes」、 「disconnect time」、「user must logon to change password」、 「password history」、「lockout duration」、 「min password length」、「maximum password age」、 「bad lockout attempt」である。

例: pdbedit -P "bad lockout attempt"

account policy value for bad lockout attempt is 0
-C account-policy-value

アカウントポリシーを指定した値に設定する。 このオプションは、-P オプションと組み合わせて使用する。

例: pdbedit -P "bad lockout attempt" -C 3

account policy value for bad lockout attempt was 0
account policy value for bad lockout attempt is now 3
-y

-y オプションを指定すると、 -i in-backend -e out-backend オプションはユーザーデータベースではなく、 アカウントポリシーに対して適用される。

このオプションにより、 アカウントポリシーをデフォルトの TDB から LDAP ディレクトリサーバなどのパスワードデータベースに移行することが可能となる。

例: pdbedit -y -i tdbsam: -e ldapsam:ldap://my.ldap.host

-h|--help

Print a summary of command line options.

-d|--debuglevel=level

level is an integer from 0 to 10. The default value if this parameter is not specified is 0.

The higher this value, the more detail will be logged to the log files about the activities of the server. At level 0, only critical errors and serious warnings will be logged. Level 1 is a reasonable level for day-to-day running - it generates a small amount of information about operations carried out.

Levels above 1 will generate considerable amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log data, most of which is extremely cryptic.

Note that specifying this parameter here will override the parameter in the smb.conf file.

-V|--version

Prints the program version number.

-s|--configfile <configuration file>

The file specified contains the configuration details required by the server. The information in this file includes server-specific information such as what printcap file to use, as well as descriptions of all the services that the server is to provide. See smb.conf for more information. The default configuration file name is determined at compile time.

-l|--log-basename=logdirectory

Base directory name for log/debug files. The extension ".progname" will be appended (e.g. log.smbclient, log.smbd, etc...). The log file is never removed by the client.