設定を行う上で、色々と問題が発生しました。もしsambaを御利用になるのでしたら、sambaを再インストールしてください。
ftp://mirror.nucba.ac.jp/pub/samba/からダウンロードができます。
また、SlackWareのSOURCE/Nにsamba-2.2.0a_tar.gzがあるのでそれを使うのもよいのではないでしょうか
SAMBAの設定は一筋縄ではできませんでした。根気・忍耐・寛容が必要です。(LINUXには常に必要ですね(^○^))
設定で困った時はhttp://samba.bento.ad.jp/SAMBAの日本語マニアル
SAMBAはマシンを起動しますと自動的にSAMBAも起動されますので、SAMBAを終了させます。
# killall smbd
# killall nmbd
#cd /usr/local/
/uer/local# mv samba samba-old で現行のSAMBAをコピーしておく。
インストールについては、Slackware-8.0のsource添付されているsamba-2.2.0aのインストール方法を説明します。
# mount -t iso9660 /dev/cdrom /cdrom # cd /usr/local/src /usr/local/src# tar zxvf /cdrom/slackware/source/n/samba/samba-2.2.0a_tar.gz /usr/local/src# cd samba-2.2.0a/source /usr/local/src/samba-2.2.0a/source# ./configure /usr/local/src/samba-2.2.0a/source# make /usr/local/src/samba-2.2.0a/source# make install |
/usr/local/src/samba-2.2.0a/source# cp /usr/local/src/samba-2.2.0a/examples/smb.conf.default /etc/samba/lib/smb.conf Slackwareでは、smb.confは/etc/samba/libにおかれることになっていますので注意してください。 /usr/local/src/samba-2.2.0a/source# cd /etc/samba/lib /etc/samba/lib# vi smb.conf で以下の赤字部分を修正しました。 ======================================================================================================== # This is the main Samba configuration file. You should read the # smb.conf(5) manual page in order to understand the options listed # here. Samba has a huge number of configurable options (perhaps too # many!) most of which are not shown in this example # # Any line which starts with a ; (semi-colon) or a # (hash) # is a comment and is ignored. In this example we will use a # # for commentry and a ; for parts of the config file that you # may wish to enable # # NOTE: Whenever you modify this file you should run the command "testparm" # to check that you have not many any basic syntactic errors. # #======================= Global Settings ===================================== [global] # workgroup = NT-Domain-Name or Workgroup-Name, eg: REDHAT4 workgroup = NTドメイン名もしくはワークグループ名 workgroup = WORKGROUP # server string is the equivalent of the NT Description field NTの解説フィールドと同等 server string = Samba Server # This option is important for security. It allows you to restrict このオプションはセキュリティ上重要です。この設定によってローカルネット # connections to machines which are on your local network. The ワークにおけるマシンからの接続を制限することが可能です。以下の例では2つの # following example restricts access to two C class networks and クラスCのネットワークと”ループバック”インターフェースからの接続のみを # the "loopback" interface. For more examples of the syntax see 許可するという制限です。この文法についての詳細につきましては、smb.conf # the smb.conf man page のマニアルページを参照してください。 hosts allow = 192.168.0. 127. ローカルネットワークとループバッックアドレスを指定します。 # If you want to automatically load your printer list rather もし、プリンタのリストを個々に設定するのではなく、自動的にプリンタのリスト # than setting them up individually then you'll need this を読み込む場合は、ここを設定する必要があります load printers = yes # you may wish to override the location of the printcap file printcapファイルの場所を指定したい場合は、ここを設定します。 ; printcap name = /etc/printcap # on SystemV system setting printcap name to lpstat should allow SystemVのシステムにおいて、printcap名をlpstatに設定する場合は、 # you to automatically obtain a printer list from the SystemV spool SystemVスプールシステムから自動的にプリンタのリストを得ることができます。 # system printcap name = /etc/printcap プリンタの指定です。プリンタ設定時を確認してください、 # It should not be necessary to specify the print system type unless もし、標準でない印刷システム(プリンタ)を使用している場合は、この設定が必要です。 # it is non-standard. Currently supported print systems include: bsd, sysv, plp, lprng, aix, hpux, qnx が利用可能です # bsd, sysv, plp, lprng, aix, hpux, qnx printing = bsd BSD(標準)で印刷します。 # Uncomment this if you want a guest account, you must add this to /etc/passwd ゲストアカウントが必要な場合は、コメントをはずします。また、nobodyを # otherwise the user "nobody" is used 以外を指定する場合は/etc/passwdにユーザを登録する必要があります。 ; guest account = pcguest # this tells Samba to use a separate log file for each machine 接続されているマシンごとに各々ログを残す場合は、コメントをはずします。 # that connects log file = /usr/local/samba/var/log.%m # Put a capping on the size of the log files (in Kb). ログファイルの最大容量でKB(キロバイト)単位で指定します。 max log size = 50 # Security mode. Most people will want user level security. See セキュリティモード、Userレベルのセキュリティを多くの人々が必要としているでしょう # security_level.txt for details. 詳細については、security_level.txt を参照。 security = user # Use password server option only with security = server security = serverの場合は、password serverを使用しましょう。 ; password server = |
ここでは、SMB.CONFが正しく設定できたか否かの確認を行います。
# /usr/local/samba/bin/testparm と入力しますと以下のメッセージが表示されます。
Load smb config files from /usr/local/samba/lib/smb.conf
Processing Section "[homes]"
Processing Section "[netlogon]"
Processing Section "[tanaka]"
Processing Section "[hirosima]"
Processing Section "[cdrom]"
Processing Section "[printers]"
Load service file OK.
Press enter to see a dump of your service definitions [Enter]を押してください、もし、不幸にして上記のメッセージが表示されない
場合はsmb.confの設定を間違えている可能性があります。
# Global parameters
debuglevel = 2
syslog = 1
syslog only = no
protocol = NT1
security = SHARE
max disk size = 0
lpq cache time = 10
announce as = NT
encrypt passwords = NO
[lp]
path = /usr/spool/samba
read only = NO
guest ok = OK
print ok = OK
share mode = NO
oplocks = NO
printer = LP
[BJC-465J]
comment = lp
path = /usr/spool/samba
read only = NO
guest ok = OK
print ok = OK
:
:
:
|
# cd /usr/local/samba/lib/ /usr/local/samba/lib/# mkdir lmhosts /usr/local/samba/lib/# vi lmhosts ======================================================================================================= 0.0.0.0 WORKGROUP G ワークグループ名を確認してください。 # 192.168.0.1 you IPアドレス、ホスト名をいれます。 192.168.0.255 WORKGROUP S ======================================================================================================== |
# mkdir /usr/local/samba/logon logonのディレクトリーを作成します。 # mkdir /usr/spool/samba # chmod 777 /usr/spool/samba |
暗号化パスワードを使用する場合は、以下の要領でSAMBA専用パスワードファイルを作成します。
# cd /usr/local/src/samba-2.2.0a/source /usr/local/src/samba-2.2.0a/source# mkdir /usr/local/samba/private /usr/local/src/samba-2.2.0a/source# cd script /usr/local/src/samba-2.2.0a/source/script# chmod 700 mksmbpasswd.sh /usr/local/src/samba-2.2.0a/source/script# cat /etc/passwd | ./mksmbpasswd.sh > /usr/local/samba/private/smbpasswd /usr/local/src/samba-2.2.0a/source/script# chmod 500 /usr/local/samba/private /usr/local/src/samba-2.2.0a/source/script# chmod 600 /usr/local/samba/private/smbpasswd |
# /usr/local/samba/bin/smbpasswd hirosima hirosimaの部分を変更してください。 New SMB password: 新しいパスワードを入力します。 Retry new SMB password: もう一度、新しいパスワードを入力します。 |
smbclientでのテスト
#cd /etc/rc.d
#etc/rc.d#touch rc.samba
#etc/rc.d#chmod 775 rc.samba
#etc/rc.d#vi rc.samba
/usr/sbin/smbd -D を /usr/local/samba/sbin/smbd -D に変更する。
/usr/sbin/nmbd -D を /usr/local/samba/sbin/nmbd -D に変更する。
:wqで終わって一度、マシンを再立ち上げを行う。
# /usr/local/samba/bin/smbclient -L //hero01 hero01の部分は、自分のホスト名をいれます。
Added interface ip=192.168.0.1 bcast=192.168.0.255 nmask=255.255.255.0
Server time is mon Mar 15 21:12:48 1999
password: Enterを押してください、
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 2.0.6]
connected as guest security=user
:
: と出ればOKですが、不幸にしてエラーとなられた方はDNSは立ち上がっていますか?
:
|
WINDOWSに繋ぐ場合は、繋ぐPC毎に以下の設定を行ってください。
「コントロールパネル」→「ネットワーク」
◆TCP−IP IPアドレス・・・・・・192.168.2.34(PCのアドレスを設定)
サブネットマスク・・・・255.255.255.0(Cクラスの場合は)確認してください、
◆microsoftネットワーク クライアント
クイックログオンを指定する
◆ユーザ情報 コンピュータ名・・・・・win1(自分のコンピュータ名)
ワークグループ・・・・・WORKGROUP(定義したワークグループ名)
◆アクセス権の管理 共通レベルのアクセス管理を選択
これでPCを再起動したら、ユーザID、とパスワードを聞きにきますので、正しく入れるとOKです。
|
何かが不足していますね。そうなんですsmbfsが足りないのです。smbfsは以下の要領で行ないました。
# smbmount //hero01/hirosima /mnt /hero01/hirosimaのところを変更してください、 エラーが出ないように注意しましょう。ここで、パスワードエラーが発生した場合は、guest ok = noとなっている時rootでもマウントはできませんので、一度yesにしてください。 |
# /usr/local/samba/bin/nmbd -D # /usr/local/samba/bin/smbd -D # /etcr/rc.d/rc.samba でSAMBAが即起動します。 |
Windows98からSAMBAに接続する為にパスワードを入力してもSAMBAに接続
できませんでした。Win95の時は問題なく接続できたのですが,,,,,,,,,?
この原因はWindows98が暗号化パスワードを利用しているためです。
そこで、以下の要領で平文パスワードをWin98から送るようにしました。