◆当blogは、Linuxサーバ構築する際の実際の設定手順を個人的メモとして記載しております。LinuC試験の役に立つ情報があるかも…?
[root]# vi /etc/samba/smb.conf←SAMBAの設定
■↓以下のように編集■
workgroup = ドメイン名
server string = 表示させる文字列
hosts allow = 192.168.0. 127.←アクセス許可
security = user←認証方式
remote announce = 192.168.0.255←ローカルネットへ通知
■↓以下の行追記■
invalid users = root←禁止ユーザ
coding system = euc←文字コード
client code page = 932←クライアント側の文字コード
[root]# testparm -s←設定を確認する
[root]# cat /etc/passwd | mksmbpasswd.sh > smbpasswd←sambaパスワードファイル作成
[root]# chmod 0600 smbpasswd←rootのみ権限設定
[root]# chmod 0500 /etc/samba←rootのみ権限設定
[root]# smbpasswd reverie←sambaパスワード設定
New SMB password:←パスワード入力
Retype new SMB password:←確認の為にもう一度パスワード入力
Password changed for user reverie.
Password changed for user reverie.
[root]# tail /etc/samba/smbpasswd←sambaパスワードが追加されているのを確認
reverie:500:E52CAC67419A9A224A3B108F3FA6CB6D:8846F7EAEE8FB117AD06BDD830B7586C:[U ]:LCT-4CE39C83:reverie
[root]# more /etc/sysconfig/samba←samba起動パラメータの確認
# Options to smbd
SMBDOPTIONS="-D"
# Options to nmbd
NMBDOPTIONS="-D"
# Options for winbindd
WINBINDOPTIONS=""
[root]# /etc/rc.d/init.d/smb restart←samba再起動
SMBサービスを停止中: [失敗]
NMBサービスを停止中: [失敗]
SMBサービスを起動中: [ OK ]
NMBサービスを起動中: [ OK ]
[root]# tail /var/log/messages←システムログで起動確認
Nov 17 16:17:04 reverie xfs: ignoring font path element /usr/X11R6/lib/X11/fonts/cyrillic (unreadable)
Nov 17 16:17:08 reverie kernel: mice: PS/2 mouse device common for all mice
Nov 17 16:35:16 reverie sshd(pam_unix)[1339]: session opened for user reverie by (uid=500)
Nov 17 16:35:18 reverie 11月 17 16:35:18 su(pam_unix)[1369]: session opened for user root by reverie(uid=500)
Nov 17 18:11:43 reverie 11月 17 18:11:43 su(pam_unix)[1369]: session closed for user root
Nov 17 18:11:57 reverie 11月 17 18:11:57 su(pam_unix)[7908]: session opened for user root by reverie(uid=500)
Nov 17 18:19:59 reverie 11月 17 18:19:59 smb: smbd停止 failed
Nov 17 18:19:59 reverie 11月 17 18:19:59 smb: nmbd停止 failed
Nov 17 18:19:59 reverie 11月 17 18:19:59 smb: smbd起動 succeeded
Nov 17 18:19:59 reverie 11月 17 18:19:59 smb: nmbd起動 succeeded
[root]# more /var/log/samba/log.nmbd←nmbのログ
[2010/11/17 18:19:59, 0] nmbd/nmbd.c:main(794)
Netbios nameserver version 2.2.7a started.
Copyright Andrew Tridgell and the Samba Team 1994-2002
[2010/11/17 18:20:03, 0] nmbd/nmbd_responserecordsdb.c:find_response_record(235)
find_response_record: response packet id 14426 received with no matching record.
[2010/11/17 18:20:03, 0] nmbd/nmbd_responserecordsdb.c:find_response_record(235)
find_response_record: response packet id 14427 received with no matching record.
[root]# more /var/log/samba/log.smbd←smbのログ
[2010/11/17 18:19:59, 0] smbd/server.c:main(707)
smbd version 2.2.7a started.
Copyright Andrew Tridgell and the Samba Team 1992-2002
[root]# vi /etc/hosts
■↓以下のように追記■
192.168.0.50 win50.example.com win50←sambaクライアントのIP,ドメイン名,ホスト名
[root]# vi /etc/samba/lmhosts
■↓以下のように追記■
192.168.0.99 reverie←sambaサーバのIPとホスト名
192.168.0.50 win50←sambaクライアントのIPとホスト名
←Windowsクライアントからワークグループ内にあるsambaサーバへアクセスする
[root]# smbstatus←Windowsクライアントからのアクセスを確認
Samba version 2.2.7a
Service uid gid pid machine
----------------------------------------------
IPC$ reverie reverie 7999 win50 (192.168.0.50) Wed Nov 17 18:33:57 2010
IPC$ nobody nobody 7999 win50 (192.168.0.50) Wed Nov 17 18:34:00 2010
reverie reverie reverie 7999 win50 (192.168.0.50) Wed Nov 17 18:34:00 2010
No locked files
[root]# tail /var/log/messages←sambaセッションを確認
Nov 17 18:33:57 reverie samba(pam_unix)[7999]: session opened for user reverie by (uid=0)
COMMENT