smbd
and nmbd
.
dpkg-reconfigure samba-common samba
を使えば、後から各設定をやり直す事が可能です。
FALCOTNET
です)。もう 1 つの質問で、パスワードを暗号化するか否かを尋ねられます。この質問には、暗号化するべきと答えます。なぜなら、最近の Windows クライアントはほとんど暗号化を要求するからです; 加えて、パスワードの暗号化は安全性を高めます。パスワードの暗号化の欠点は、Samba パスワードを Unix パスワードと別に管理する必要がある点です。
inetd
を使って起動するか、独立したデーモンとして運用するかを尋ねられます。inetd
を使う選択肢は Samba を滅多に使わない場合を除けば効果的とはいえません; このため Falcot の管理者は独立したデーモンとして運用することを選びました。
/etc/samba/smb.conf
設定ファイルに含まれる他のオプションを変更することが必要です。以下の抜粋は [global]
セクションに対する変更点を要約したものです。
[global] ## Browsing/Identification ### # Change this to the workgroup/NT-domain name your Samba server will part of workgroup = FALCOTNET # server string is the equivalent of the NT Description field server string = %h server (Samba %v) # Windows Internet Name Serving Support Section: # WINS Support - Tells the NMBD component of Samba to enable its WINS Server wins support = yes[...] ####### Authentication ####### # "security = user" is always a good idea. This will require a Unix account # in this server for every user accessing the server. See # /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html # in the samba-doc package for details. security = user
# You may wish to use password encryption. See the section on # 'encrypt passwords' in the smb.conf(5) manpage before enabling. encrypt passwords = true # If you are using encrypted passwords, Samba will need to know what # password database type you are using. passdb backend = tdbsam [...] ########## Printing ########## # If you want to automatically load your printer list rather # than setting them up individually then you'll need this load printers = yes
# lpr(ng) printing. You may wish to override the location of the # printcap file ; printing = bsd ; printcap name = /etc/printcap # CUPS printing. See also the cupsaddsmb(8) manpage in the # cups-client package. printing = cups
printcap name = cups
Samba がローカルネットワークの Netbios ネームサーバ (WINS) として振る舞うことを意味します。
| |
これは security パラメータのデフォルト値です; しかしながら、security パラメータは Samba 設定の要ですから、明示的に指定することをお勧めします。各ユーザは、共有の種類に関わらず必ず共有にアクセスする前に認証を必要とします。
| |
Samba が CUPS 設定に存在する全てのローカルプリンタを自動的に共有することを意味します。適切なセクションを追加すれば、これらのプリンタへのアクセスを制限することも可能です。
| |
使用する印刷システムを指定します; 我々の場合、CUPS です。
|
adduser
を使います)。
smbpasswd -a user
コマンドを実行します。コマンドは対話的にパスワードを尋ねます。
smbpasswd -x user
コマンドを実行します。Samba アカウントを一時的に利用不可能にしたり (smbpasswd -d user
を使います)、再度利用可能にすること (smbpasswd -e user
を使います) も可能です。
[global]
セクションに数個の追加的指示文を追加しました:
domain logons = yespreferred master = yes logon path = \\%L\profiles\%U
logon script = scripts/logon.bat
ドメインコントローラの機能を有効化します。
| |
ユーザのホームディレクトリの位置を指定します。ユーザのホームディレクトリは専用の共有に保存されており、特定のオプション (特に Windows 2000、XP、Vista と互換性を保つために必要な profile acls ) を有効化することが可能です。
| |
batch (非対話的) スクリプトを指定します。このスクリプトはセッションの開始毎にクライアントの Windows マシンで実行されます。この場合、 /var/lib/samba/netlogon/scripts/logon.bat です。このスクリプトは DOS フォーマットにしてください。つまり各行をキャリッジリターン文字とラインフィード文字で分割してください; このスクリプトを Linux で作成した場合、unix2dos を使って変換してください。
このスクリプトの中では、ネットワークドライブを自動作成したり、システム時間を同期するためのコマンドがよく使われます。
|
[netlogon] comment = Network Logon Service path = /var/lib/samba/netlogon guest ok = yes writable = no share modes = no [profiles] comment = Profile Share path = /var/lib/samba/profiles read only = No profile acls = Yes
/var/lib/samba/profiles/user
に) 作成され、各ホームディレクトリは必ず対応するユーザに所有されていなければいけません。
smbclient
プログラムは SMB サーバに問い合わせを行います。特定のユーザ識別情報を使ってサーバに接続するには、-U user
オプションを使います。smbclient //server/share
はコマンドライン FTP クライアントに類似した対話的方法を使って共有にアクセスします。smbclient -L server
は対象のサーバで利用可能な (見える) 共有を全部リストします。
mount
コマンドを使うことで、Windows 共有を Linux ファイルシステム階層にマウントすることが可能になります (cifs-utils の提供する mount.cifs
の助けを借ります)。
例11.28 Windows 共有をマウントする
mount -t cifs //arrakis/shared /shared \ -o credentials=/etc/smb-credentials
/etc/smb-credentials
ファイルは (ユーザはこのファイルを読み込むことはできません) 以下の書式で書かれています:
username = user password = password
uid
と gid
を使うことで、マウントされたことで利用可能になったファイルの所有者とグループを指定したものに強制することが可能になります。これを指定することで、root 以外のユーザもマウント先にアクセス可能になります。
/etc/fstab
の中に設定を書いて、Windows 共有をマウントすることも可能です:
//server/shared /shared cifs credentials=/etc/smb-credentials
umount
コマンドを使います。
http://localhost:631/admin
smb://user:password@server/printer
.