プロが教える店舗&オフィスのセキュリティ対策術

いつも、ホントありがとうございます。
サンバについては以前導入しようとしたときも、いろいろ質問させてもらったのですが、
時は流れ、以前に使用していた設定ファイルを参考にしてもうまく動かないくらいサンバが刷新されてしまったようです。

今の私のやりたいことは、とりあえずエクスプローラへサンバサーバーを表示させることです。
ワークグループを表示させようとすると、他の全てのWindows機は表示されるのですが、サンバサーバーが表示されません。
エクスプローラーのアドレス欄へ直接\\サーバー名を入力するとサンバサーバーの共有フォルダを読むことが出来るため、基本的な通信自体はできているようです。
smb.confをいろいろ変更しているのですが、なかなか私の思うとおりには動かないのです。
現時点では原因を特定するために次のとおり極小のsmb.confとなっています。
[global]
security = share
workgroup = ワークグループ名(他のWindows機と統一)
[pub]
path = /home/smb
public = yes
これにどのような設定を追記すれば、サンバサーバーが表示されるようになるか。
はたまた、smb.confファイル以外に注意すべき点があるのかどうか。
どなたか、助言をお願いします。

A 回答 (7件)

No.1, No.5です。



Macユーザですが、Parallels上にWinとDebianが入っていますので
確認は可能です。ただ、使う意味はないので今まで使っていなかった
だけですよ。
確認はParalles上のDebianにsambaを入れてParallels上のWinXPから見ています。


しかし謎ですね。
netstat -an | grep 13[789]
とかしても、
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN
udp 0 0 10.211.55.4:137 0.0.0.0:*
udp 0 0 0.0.0.0:137 0.0.0.0:*
udp 0 0 10.211.55.4:138 0.0.0.0:*
udp 0 0 0.0.0.0:138 0.0.0.0:*
みたいになりますよね・・・。


まさかとは思いますが、host名だと別ルートで名前解決されてしまう
とか。

試しに、[global]にnetbios nameを追加して試したらどうなりますか?

私は下記の設定にしています。
ちなみに、umane -nの出力はmacdebianです。
[global]
security = share
workgroup = WORKGROUP
netbios name = pDebian
[pub]
path = /tmp
public = yes

ドメインの設定が何かに引っかかってしまうとか・・・
謎です。
    • good
    • 0
この回答へのお礼

P-mannさん再々返信感謝です。
Parallels Desktopなるものをちょびっと調べてみました。
マックユーザーでありながら、Windowsやリナックスの学習もされている方だったとは^^

netstat -an | grep 13[789]
とすると
TCP XP機のIPアドレス:139 0.0.0.0:0 LISTENING
UDP XP機のIPアドレス:137 *:*
UDP XP機のIPアドレス:138 *:*
のようになります。(意味不明(x_x))

smb.confを次のとおり編集しました。
[global]
security = share
workgroup = ワークグループ名(他のWindows機と統一)
netbios name = cat(ドメイン名なしのサンバサーバー名)
[pub]
path = /home/smb
public = yes
結果は残念ながらダメでした。

uname -nの出力はcat.xxx.xxx.xxxのようにドメイン名付きのサンバサーバー名でした。

さらに、その後の調査で判明した事柄を以下へ記載します。
新旧のサンバサーバーに同じsmb.confを適用することでsmb.confの不正箇所の特定を試みました。
遅ればせながらサンバサーバーの環境をご紹介します。

旧サーバー
Red Hat Linux 8
samba-2.2.5-10

新サーバー
Fedora 10
samba-3.2.7-0.25.fc10.i386

smb.confは両サーバーとも次のとおりです。
[global]
security = share
workgroup = ワークグループ名(他のWindows機、新旧サンバサーバー全てで統一)
[pub]
path = /home/smb
public = yes

この調査の結果は奇怪なことに旧サーバーのみ表示され、新サーバーは表示されないという、質問当初の現象そのものでした。
smb.confに記載しない項目は、規定の設定が採用されるようですが、最近のサンバは規定の設定が見直され変更されていると考えるのが妥当でしょうか。
smb.confが同じにも関わらずサンバの挙動が相違することから、この見解にたどり着きました。

だとすれば、どこをどのように直せば良いのやら・・・うーん

お礼日時:2009/02/14 15:52

Winは会社で使っていますし、Debianは学生時代に使っていただけですよ。



ますます謎ですね。
私の知識を遙かに超越していますので、あまりお役に立てなさそうです。


原点に立ち戻ってログを確認してみてはどうでしょうか。

/var/log/log.smbd
/var/log/log.nmbd
あたり?
# Debianだと/var/log/samba/log.smbdなどとなるので
# 正確なパスが分からないです・・・

今回は名前関係ですのでlog.nmbdの方でしょう。
何かエラーが出ているかもしれません。

色々と疑問はあります。
・Linux同士で互いに相手は見えているのか?
・ワークグループ内でのマスタは誰なのか?あるいはWINS使用?
・WindowsのNBTテーブルはどうなっているのか?

このあたりから動いていない部分を割り出せれば解決できるかと。

Linuxサーバでfindsmb、Windowsでnbtstatなどを使用することで
ある程度の解析は可能なはずです。
使い方は検索すれば見つかるかと思います。
# その他、色々とコマンドがあるようですが、私はあまり詳しく
# ないので・・・
    • good
    • 0
この回答へのお礼

P-mannさん再々々返信ありがとうございます。
色々なトラブルシュート手法のご提案をありがとうございます。
ご提案いただいた手法を1つ1つ試すことも考えたのですが、
実は私は既に、もっと手っ取り早い解決策に向かって動いてしまっていました。
デフォルトでブラウジングが無効になってしまう1つ前のサンババージョンを導入するというものです。
これは私にとっても、回答者の皆さんにとっても(??)不本意な決断ではありますが、押しても引いてもさっぱり反応しないサンバに、私の調査意欲が敗北してしまいました。
一時はsmb.confのドキュメントを上から下まで全部読んでやろうと行動に移したのですが、まもなく気が遠くなりやめました^^

お礼日時:2009/02/15 00:58

>No.4 dummさん


No.1です。なるほど。勉強になります。

というか、もっときちんと質問を読むべきでしたね。
「Workgroupにアクセスしたときにサーバが表示されない」と
いうことでしたか。


ということは、NetBIOSによる名前解決でしょうか。
Windowsからサーバ名(NetBIOS名)でpingを打つとどうなりますか?
これが通らなければfirewall(iptablesかな・・・ipfw?)を停止
した場合にどうなるか確認してみてください。

もしfirewallのせいであれば、確か137/udp, 138/udp,
139/tcpをあければよかったと思います。

# debianにsambaを入れて同じ設定にしましたが、普通に表示されます。
# iptablesは未使用です。
    • good
    • 0
この回答へのお礼

P-mannさんマックユーザーにも関わらず再返信ありがとうございます^^
Windows機からサンバサーバーへのpingはドメイン名付きホスト名、単体ホスト名どちらでもOKでした。
またiptablesは不具合調査中につき、すでに停止させていたのでした^^

P-mannさん、私と同じ設定でサンバを動かしてくれたのですか!?
何ともお手数をおかけします・・・
でもマックとウィンドウズでは制御に差があるのでしょうね。
私の環境では、うんともすんともです・・・

お礼日時:2009/02/14 02:49

browseableのデフォルト値はyesです


ついでに言うとbrowseableは\\サーバー名にアクセスしたときに共有フォルダ一覧に表示されるかどうかでブラウジングサービスとは無縁です

参考URL:http://www.samba.gr.jp/project/translation/3.0/h …
    • good
    • 0
この回答へのお礼

dummさん、ご返信ありがとうございます。
確かにbrowseable = yesは記述しても、しなくとも挙動は同じようです。
逆にbrowseable = noとしたら、pubフォルダが見えなくなりました。

そんな物知りなdummさんより、今ひとつ私への助言をプリーズプリーズ!!

お礼日時:2009/02/14 02:28

とりあえず、可視できるように設定してみてはどうですか。


[pub]
path = /home/smb
public = yes
browseable = yes
    • good
    • 0
この回答へのお礼

donnisさん、ご返信ありがとうございます。
browsable = yes
の代わりに
browseable = yes
としてみましたが、ダメでした・・・

お礼日時:2009/02/14 02:21

#======================= Global Settings =====================================


[global]

dos charset = CP932
unix charset = UTF-8
display charset = EUCJP-MS

# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
workgroup = MYGROUP
# server string is the equivalent of the NT Description field
server string = Samba Server
# Security mode. Defines in which mode Samba will operate. Possible
# values are share, user, server, domain and ads. Most people will want
# user level security. See the Samba-HOWTO-Collection for details.
security = user
# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
; hosts allow = 192.168.1. 192.168.2. 127.
hosts allow = 192.168.1. 127.
# Configure Samba to use multiple interfaces
# If you have multiple network interfaces then you must list them
# here. See the man page for details.
; interfaces = 192.168.12.2/24 192.168.13.2/24
interfaces = 192.168.1.1/24 127.0.0.1/8
bind interfaces only = yes
socket address = 192.168.1.1

# Configure remote browse list synchronisation here
# request announcement to, or browse list sync from:
# a specific host or from / to a whole subnet (see below)
; remote browse sync = 192.168.3.25 192.168.5.255
# Cause this host to announce itself to local subnets here
; remote announce = 192.168.1.255 192.168.2.44
remote announce = 192.168.1.255

# Browser Control Options:
# set local master to no if you don't want Samba to become a master
# browser on your network. Otherwise the normal election rules apply
local master = yes

# OS Level determines the precedence of this server in master browser
# elections. The default value should be reasonable
### os level = 33
os level = 65

# Domain Master specifies Samba to be the Domain Master Browser. This
# allows Samba to collate browse lists between subnets. Don't use this
# if you already have a Windows NT domain controller doing this job
domain master = yes

# Preferred Master causes Samba to force a local browser election on startup
# and gives it a slightly higher chance of winning the election
preferred master = yes

# Enable this if you want Samba to be a domain logon server for
# Windows95 workstations.
domain logons = yes

# if you enable domain logons then you may want a per-machine or
# per user logon script
# run a specific logon batch file per workstation (machine)
; logon script = %m.bat
# run a specific logon batch file per username
; logon script = %U.bat

# Where to store roving profiles (only for Win95 and WinNT)
# %L substitutes for this servers netbios name, %U is username
# You must uncomment the [Profiles] share below
; logon path = \\%L\Profiles\%U

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
wins support = yes

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = 192.168.1.1

# WINS Proxy - Tells Samba to answer name resolution queries on
# behalf of a non WINS capable client, for this to work there must be
# at least one WINS Server on the network. The default is NO.
; wins proxy = yes

# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The default is NO.
dns proxy = no
上記はsamba3系のconfigで、sambaサーバーがwinsの機能を有するものです。
お試しに・・・
    • good
    • 0
この回答へのお礼

nolixさん、ご返信ありがとうございます。
nolixさんご提示のsmb.confを参考にいろいろ試してみましたが、なかなかうまくいきません。

最終的にnolixさんの設定を可能な限り引き継がせるべく必要最小限の修正を施しました。
修正点は次の3項目です。
workgroup
interfaces
socket address

smb.conf全体としては次のとおりです(コメント行は全部除去しました)。
[global]
dos charset = CP932
unix charset = UTF-8
display charset = EUCJP-MS
workgroup = ワークグループ名(他のWindows機と統一)
server string = Samba Server
security = user
hosts allow = 192.168.1. 127.
interfaces = サンバサーバーのIPアドレス/24 127.0.0.1/8
bind interfaces only = yes
socket address = サンバサーバーのIPアドレス
remote announce = 192.168.1.255
local master = yes
os level = 65
domain master = yes
preferred master = yes
domain logons = yes
wins support = yes
dns proxy = no

この設定を適用してみたのですが、残念ながらダメでした・・・。
うーん・・・サンバ手強い・・・

お礼日時:2009/02/14 02:16

MacユーザなのでSambaはあまり使わないのですが、


むかしむかーしの記憶によると、[pub]に

browsable = yes

とか書かないとダメだったような気がします。
何か他にも設定が必要かもしれませんが。

Sambaのドキュメントなどを参照するといいかもしれません。
「samba browsable」で検索すれば何か見つかるかもしれませんが。
    • good
    • 0
この回答へのお礼

P-mannさん、ご返信ありがとうございます。
browsable = yesを追加してみましたがダメでした・・・。

お礼日時:2009/02/14 01:16

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!