= Samba = == Sambaのインストール == {{{ [imadahirosi@yellow ~]$ sudo yum install samba Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package samba.x86_64 0:3.5.4-68.el6_0.2 set to be updated --> Finished Dependency Resolution Dependencies Resolved ============================================================================================== Package Arch Version Repository Size ============================================================================================== Installing: samba x86_64 3.5.4-68.el6_0.2 sl-security 5.0 M Transaction Summary ============================================================================================== Install 1 Package(s) Upgrade 0 Package(s) Total download size: 5.0 M Installed size: 17 M Is this ok [y/N]: y Downloading Packages: samba-3.5.4-68.el6_0.2.x86_64.rpm | 5.0 MB 00:04 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : samba-3.5.4-68.el6_0.2.x86_64 1/1 Installed: samba.x86_64 0:3.5.4-68.el6_0.2 Complete! }}} == ユーザーの登録 == {{{ [imadahirosi@yellow ~]$ sudo pdbedit -a -u imadahirosi new password: retype new password: tdbsam_open: Converting version 0.0 database to version 4.0. tdbsam_convert_backup: updated /var/lib/samba/private/passdb.tdb file. account_policy_get: tdb_fetch_uint32 failed for type 1 (min password length), returning 0 account_policy_get: tdb_fetch_uint32 failed for type 2 (password history), returning 0 account_policy_get: tdb_fetch_uint32 failed for type 3 (user must logon to change password), returning 0 account_policy_get: tdb_fetch_uint32 failed for type 4 (maximum password age), returning 0 account_policy_get: tdb_fetch_uint32 failed for type 5 (minimum password age), returning 0 account_policy_get: tdb_fetch_uint32 failed for type 6 (lockout duration), returning 0 account_policy_get: tdb_fetch_uint32 failed for type 7 (reset count minutes), returning 0 account_policy_get: tdb_fetch_uint32 failed for type 8 (bad lockout attempt), returning 0 account_policy_get: tdb_fetch_uint32 failed for type 9 (disconnect time), returning 0 account_policy_get: tdb_fetch_uint32 failed for type 10 (refuse machine password change), returning 0 Unix username: imadahirosi NT username: Account Flags: [U ] User SID: S-1-5-21-970968779-120078618-1862418121-1000 Primary Group SID: S-1-5-21-970968779-120078618-1862418121-513 Full Name: Home Directory: \\yellow\imadahirosi HomeDir Drive: Logon Script: Profile Path: \\yellow\imadahirosi\profile Domain: YELLOW Account desc: Workstations: Munged dial: Logon time: 0 Logoff time: 9223372036854775807 seconds since the Epoch Kickoff time: 9223372036854775807 seconds since the Epoch Password last set: 水, 11 5月 2011 11:02:06 JST Password can change: 水, 11 5月 2011 11:02:06 JST Password must change: never Last bad password : 0 Bad password count : 0 Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF }}} == ユーザーの削除 == {{{ [imadahirosi@yellow ~]$ sudo pdbedit -x -u imadahirosi [sudo] password for imadahirosi: }}} == サービスの起動・終了・再起動 == {{{ [imadahirosi@yellow ~]$ sudo /etc/rc.d/init.d/smb start SMB サービスを起動中: [ OK ] [imadahirosi@yellow ~]$ sudo /etc/rc.d/init.d/smb stop SMB サービスを停止中: [ OK ] [imadahirosi@yellow ~]$ sudo /etc/rc.d/init.d/smb start SMB サービスを起動中: [ OK ] [imadahirosi@yellow ~]$ sudo /etc/rc.d/init.d/smb restart SMB サービスを停止中: [ OK ] SMB サービスを起動中: [ OK ] }}} == サービスの登録 == {{{ [imadahirosi@yellow ~]$ sudo chkconfig smb on [imadahirosi@yellow ~]$ chkconfig acpid 0:off 1:off 2:on 3:on 4:on 5:on 6:off atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off auditd 0:off 1:off 2:on 3:on 4:on 5:on 6:off autofs 0:off 1:off 2:off 3:on 4:on 5:on 6:off cgconfig 0:off 1:off 2:off 3:off 4:off 5:off 6:off cgred 0:off 1:off 2:off 3:off 4:off 5:off 6:off cpuspeed 0:off 1:on 2:on 3:on 4:on 5:on 6:off crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off cups 0:off 1:off 2:on 3:on 4:on 5:on 6:off haldaemon 0:off 1:off 2:off 3:on 4:on 5:on 6:off ip6tables 0:off 1:off 2:on 3:on 4:on 5:on 6:off ipsec 0:off 1:off 2:off 3:off 4:off 5:off 6:off iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off irqbalance 0:off 1:off 2:off 3:on 4:on 5:on 6:off kdump 0:off 1:off 2:off 3:on 4:on 5:on 6:off lvm2-monitor 0:off 1:on 2:on 3:on 4:on 5:on 6:off mdmonitor 0:off 1:off 2:on 3:on 4:on 5:on 6:off messagebus 0:off 1:off 2:on 3:on 4:on 5:on 6:off microcode_ctl 0:off 1:off 2:on 3:on 4:on 5:on 6:off netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off netfs 0:off 1:off 2:off 3:on 4:on 5:on 6:off network 0:off 1:off 2:on 3:on 4:on 5:on 6:off nfs 0:off 1:off 2:off 3:off 4:off 5:off 6:off nfslock 0:off 1:off 2:off 3:on 4:on 5:on 6:off nmb 0:off 1:off 2:off 3:off 4:off 5:off 6:off portreserve 0:off 1:off 2:on 3:on 4:on 5:on 6:off postfix 0:off 1:off 2:on 3:on 4:on 5:on 6:off psacct 0:off 1:off 2:off 3:off 4:off 5:off 6:off rdisc 0:off 1:off 2:off 3:off 4:off 5:off 6:off restorecond 0:off 1:off 2:off 3:off 4:off 5:off 6:off rpcbind 0:off 1:off 2:on 3:on 4:on 5:on 6:off rpcgssd 0:off 1:off 2:off 3:on 4:on 5:on 6:off rpcidmapd 0:off 1:off 2:off 3:on 4:on 5:on 6:off rpcsvcgssd 0:off 1:off 2:off 3:off 4:off 5:off 6:off rsyslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off saslauthd 0:off 1:off 2:off 3:off 4:off 5:off 6:off smartd 0:off 1:off 2:off 3:off 4:off 5:off 6:off smb 0:off 1:off 2:on 3:on 4:on 5:on 6:off <- 3がonになっていることを確認 snmpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off snmptrapd 0:off 1:off 2:off 3:off 4:off 5:off 6:off sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off sysstat 0:off 1:on 2:on 3:on 4:on 5:on 6:off udev-post 0:off 1:on 2:on 3:on 4:on 5:on 6:off }}} == pdbedit == {{{ [imadahirosi@yellow ~]$ sudo pdbedit -h 使い方: [オプション...] -L, --list list all users -v, --verbose be verbose -w, --smbpasswd-style give output in smbpasswd style -u, --user=USER use username -N, --account-desc=文字列 set account description -f, --fullname=文字列 set full name -h, --homedir=文字列 set home directory -D, --drive=文字列 set home drive -S, --script=文字列 set logon script -p, --profile=文字列 set profile path -I, --domain=文字列 set a users' domain -U, --user SID=文字列 set user SID or RID -M, --machine SID=文字列 set machine SID or RID -a, --create create user -r, --modify modify user -m, --machine account is a machine account -x, --delete delete user -b, --backend=文字列 use different passdb backend as default backend -i, --import=文字列 import user accounts from this backend -e, --export=文字列 export user accounts to this backend -g, --group use -i and -e for groups -y, --policies use -i and -e to move account policies between backends --policies-reset restore default policies -P, --account-policy=文字列 value of an account policy (like maximum password age) -C, --value=LONG set the account policy to this value -c, --account-control=文字列 Values of account control --force-initialized-passwords Force initialization of corrupt password strings in a passdb backend -z, --bad-password-count-reset reset bad password count -Z, --logon-hours-reset reset logon hours --time-format=文字列 The time format for time parameters -t, --password-from-stdin get password from standard in -K, --kickoff-time=文字列 set the kickoff time Help options: -?, --help Show this help message --usage Display brief usage message Common samba options: -d, --debuglevel=DEBUGLEVEL Set debug level -s, --configfile=CONFIGFILE Use alternate configuration file -l, --log-basename=LOGFILEBASE Base name for log files -V, --version Print version }}}