Linux testparmコマンド
Linux testparmコマンドは、Sambaの設定が正しいかどうかをテストするために使用されます。
testparm(test parameter)コマンドを実行すると、Sambaの設定ファイルを簡単にテストできます。テスト結果に問題がなければ、Samba常駐サービスはその設定値を正しく読み込むことができますが、その後の操作が期待どおりにすべて正常に動作することを保証するものではありません。
構文
testparm [-s][配置文件][<主机名称><IP地址>]
パラメータの説明:
- -s プロンプト記号を表示せず、ユーザーがEnterキーを押すのを待たずに、Sambaサービスの定義情報を直接一覧表示します。
例
Samba設定の確認
# testparm
Load smb config files from /etc/samba/smb.conf
Processing section '[homes]'
Processing section '[printers]'
Processing section '[uptech]'
Processing section '[home]'
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
///按下回车继续
# Global parameters
[global]
workgroup = MYGROUP
server string = Samba Server
security = SHARE
encrypt passwords = No
password server = None
log file = /var/log/samba/%m.log
max log size = 50
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
printcap name = /etc/printcap
dns proxy = No
idmap uid = 16777216-33554431
idmap gid = 16777216-33554431
cups options = raw
[homes]
comment = Home Directories
read only = No
browseable = No
[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
browseable = No
[uptech]
comment = *
path = /home/uptech
read only = No
guest ok = Yes
[home]
comment = *
path = /home
read only = No
guest ok = Yes
その他の拡張
Linuxコマンド大全