pdbedit — SAM データベース (Samba ユーザーのデータベース) を管理する
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 種類がある。
データベースのすべてのユーザーアカウントを一覧表示する。 ユーザー名と UID の組み合わせが「:」で区切られて一覧表示される。
例: pdbedit -L
sorce:500:Simo Sorce samba:45:Test User
冗長な一覧表示形式を有効にする。 データベース内のユーザーを一覧表示する際には、 アカウントの各項目を詳細に表示する。
例: 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
一覧表示を「smbpasswd」形式にする。
データベース内のユーザーを一覧表示する際、
アカウントの各項目は
smbpasswd
ファイル互換の形式
(詳細は
smbpasswd(5) を参照のこと)
で表示される。
例: pdbedit -L -w
sorce:500:508818B733CE64BEAAD3B435B51404EE: D2A2418EFC466A8A0F6B1DBB5C3DB80C: [UX ]:LCT-00000000: samba:45:0F2B255F7B67A7A9AAD3B435B51404EE: BC281CE3F53B6A5146629CD4751D3490: [UX ]:LCT-3BFA1E8D:
操作 (表示・追加・削除など) の対象とするユーザー名を指定する。 追加・削除・変更操作においては必須であり、 表示操作においては任意である。
ユーザーの追加および変更を行なう際に、 ユーザーのフルネームを指定する。
例: -f "Simo Sorce"
ユーザーの追加および変更を行なう際に、 ユーザーのホームディレクトリとなるネットワークパスを指定する。
例: -h "\\\\BERSERKER\\sorce"
ユーザーの追加および変更を行なう際に、 ホームディレクトリの割り当て先とする Windows のドライブ名を指定する。
例: -D "H:"
ユーザーの追加および変更を行なう際に、 ユーザーのログオンスクリプトのパスを指定する。
例: -S "\\\\BERSERKER\\netlogon\\sorce.bat"
ユーザーの追加および変更を行なう際に、 ユーザーのプロファイルパスを指定する。
例: -p "\\\\BERSERKER\\netlogon"
ユーザーの追加および変更を行なう際に、 ユーザーのプライマリグループの SID (セキュリティ識別子) または RID を指定する。
例: -G S-1-5-21-2447931902-1787058256-3961074038-1201
ユーザーの追加および変更を行なう際に、 ユーザーの SID (セキュリティ識別子) または RID を指定する。
例: -U S-1-5-21-2447931902-1787058256-3961074038-5004
ユーザーの追加および変更を行なう際に、 ユーザーのアカウント制御プロパティを指定する。 指定可能なフラグを以下に示す:
N: パスワード不要
D: アカウント無効
H: ホームディレクトリ必須
T: 一時的に他のアカウントと重複
U: 通常のユーザーアカウント
M: MNS ログオン用のユーザーアカウント
W: コンピュータ信頼アカウント(訳注: ドメインに参加する各マシンのためのアカウント)
S: サーバー信頼アカウント
L: 自動ロック
X: 無期限パスワード
I: ドメイン信頼アカウント(訳注: 信頼関係するドメインのためのアカウント)
例: -c "[X ]"
このオプションは特定のユーザーに対してkickoff時間を 変更するために使われる。kickoff時間を無制限にする引数は、 "決して指定してはならない"。
例: pdbedit -K never user
ユーザーをデータベースに追加する際に指定する。
ユーザー名を
-u
オプションで指定する必要がある。
ユーザーを追加する際、
pdbedit はユーザーのパスワードの入力を求める。
例: pdbedit -a -u sorce
new password: retype new password
unix password sync が設定されていた場合でも、 pdbedit はスクリプトを実行せず、Samba のユーザーデータベース内のデータのみを更新する点に注意。
ユーザーの追加と同時にパスワード同期を直ちに行ないたい場合は、
smbpasswd
の -a
オプションを使用すること。
パスワードを
(passwd(1)
プログラムのように)
/dev/tty から読み取る代わりに標準入力から読み取らせる。
パスワードは二度入力し、各々末尾に改行(newline)文字を付けること。
データベースの既存のユーザーの情報を変更する際に指定する。
ユーザー名は
-u
オプションで指定する必要がある。
これ以外のオプションは、
指定したユーザーのプロパティを変更するために用いられる。
このオプションは過去との互換性を保つために残されているだけで、
現在は指定する必要はない。
このオプションは
-a
オプションと組み合わせて利用する。
これにより、
pdbedit はユーザーアカウントではなくコンピュータ信頼アカウントを追加する。
(-u username にはコンピュータ名を指定する)
例: pdbedit -a -m -u w2k-wks
データベースからユーザーを削除する際に指定する。
ユーザー名は
-u
オプションで指定する必要がある。
例: pdbedit -x -u bob
ユーザー情報の取得元となるパスワードデータベースとして、 smb.conf で指定したものとは別のものを指定する。 これは、ローカルのユーザーデータベースにデータを取り込む (インポートする) 際に利用する。
このオプションにより、 パスワードデータベースの移行を容易に行うことができる。
例: pdbedit -i smbpasswd:/etc/smbpasswd.old
指定したパスワードデータベースに存在するすべてのユーザーを転送 (エクスポート) する。
このオプションにより、 パスワードデータベースの移行とバックアップを容易に行うことが可能となる。
例: pdbedit -e smbpasswd:/root/samba-users.backup
-g
オプションを指定すると、
-i in-backend -e out-backend
オプションはユーザーデータベースではなく、
グループマッピングに対して適用される。
このオプションにより、 パスワードデータベースの移行とバックアップを容易に行うことが可能となる。
デフォルト以外のパスワードデータベースを指定する。
例: pdbedit -b xml:/root/pdb-backup.xml -l
アカウントポリシーを表示する。
有効なポリシーは、 「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
アカウントポリシーを指定した値に設定する。
このオプションは、-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
オプションを指定すると、
-i in-backend -e out-backend
オプションはユーザーデータベースではなく、
アカウントポリシーに対して適用される。
このオプションにより、 アカウントポリシーをデフォルトの TDB から LDAP ディレクトリサーバーなどのパスワードデータベースに移行することが可能となる。
例: pdbedit -y -i tdbsam: -e ldapsam:ldap://my.ldap.host
Print a summary of command line options.
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.
Prints the program version number.
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.
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.