sambaの導入(lenny)

# apt-get install samba
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
  libcups2 libgnutls26 libldap-2.4-2 libtalloc1 libwbclient0 samba-common ucf
Suggested packages:
  cups-common gnutls-bin smbldap-tools ldb-tools
The following NEW packages will be installed:
  libcups2 libgnutls26 libldap-2.4-2 libtalloc1 libwbclient0 samba samba-common ucf
0 upgraded, 8 newly installed, 0 to remove and 1 not upgraded.
Need to get 8872kB of archives.
After this operation, 25.1MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://archive.debian.org Debian-5.0/main libgnutls26 2.4.2-6+lenny2 [490kB]
Get:2 http://archive.debian.org Debian-5.0/main libldap-2.4-2 2.4.11-1+lenny2.1 [199kB]
Get:3 http://archive.debian.org Debian-5.0/main ucf 3.0016 [64.4kB]
Get:4 http://archive.debian.org Debian-5.0/main libcups2 1.3.8-1+lenny10 [175kB]
Get:5 http://archive.debian.org Debian-5.0/main libtalloc1 1.2.0~git20080616-1 [17.0kB]
Get:6 http://archive.debian.org Debian-5.0/main libwbclient0 2:3.2.5-4lenny15 [81.4kB]
Get:7 http://archive.debian.org Debian-5.0/main samba-common 2:3.2.5-4lenny15 [3438kB]
Get:8 http://archive.debian.org Debian-5.0/main samba 2:3.2.5-4lenny15 [4407kB]
Fetched 8872kB in 2min34s (57.5kB/s)
Preconfiguring packages ...



ワークグループ/ドメイン名の設定



WINSの設定

Selecting previously deselected package libgnutls26.
(Reading database ... 8341 files and directories currently installed.)
Unpacking libgnutls26 (from .../libgnutls26_2.4.2-6+lenny2_powerpc.deb) ...
Selecting previously deselected package libldap-2.4-2.
Unpacking libldap-2.4-2 (from .../libldap-2.4-2_2.4.11-1+lenny2.1_powerpc.deb) ...
Replacing files in old package libldap2 ...
Selecting previously deselected package ucf.
Unpacking ucf (from .../archives/ucf_3.0016_all.deb) ...
Moving old data out of the way
Selecting previously deselected package libcups2.
Unpacking libcups2 (from .../libcups2_1.3.8-1+lenny10_powerpc.deb) ...
Selecting previously deselected package libtalloc1.
Unpacking libtalloc1 (from .../libtalloc1_1.2.0~git20080616-1_powerpc.deb) ...
Selecting previously deselected package libwbclient0.
Unpacking libwbclient0 (from .../libwbclient0_2%3a3.2.5-4lenny15_powerpc.deb) ...
Selecting previously deselected package samba-common.
Unpacking samba-common (from .../samba-common_2%3a3.2.5-4lenny15_powerpc.deb) ...
Selecting previously deselected package samba.
Unpacking samba (from .../samba_2%3a3.2.5-4lenny15_powerpc.deb) ...
Processing triggers for man-db ...
Setting up libgnutls26 (2.4.2-6+lenny2) ...
Setting up libldap-2.4-2 (2.4.11-1+lenny2.1) ...
Installing new version of config file /etc/ldap/ldap.conf ...
Setting up ucf (3.0016) ...
Setting up libcups2 (1.3.8-1+lenny10) ...
Setting up libtalloc1 (1.2.0~git20080616-1) ...
Setting up libwbclient0 (2:3.2.5-4lenny15) ...
Setting up samba-common (2:3.2.5-4lenny15) ...

Creating config file /etc/samba/smb.conf with new version
Setting up samba (2:3.2.5-4lenny15) ...
Generating /etc/default/samba...
tdbsam_open: Converting version 0 database to version 3.
account_policy_get: tdb_fetch_uint32 failed for field 1 (min password length), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 2 (password history), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 3 (user must logon to change password), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 4 (maximum password age), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 5 (minimum password age), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 6 (lockout duration), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 7 (reset count minutes), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 8 (bad lockout attempt), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 9 (disconnect time), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 10 (refuse machine password change), returning 0
Importing account for      ...ok
........
Done.
Starting Samba daemons: nmbd smbd.

設定ファイル smb.confの編集

# nano /etc/samba/smb.conf

文字コードの設定
以下を追加する。

charset = UTF-8
dos charset = CP932
display charset = UTF-8

接続制限
以下を追加

interfaces = 192.168.100.0/24 ←接続を許可するネットワークを指定する
bind interfaces only = yes  

共有するディレクトリの作成

/samba-share/dir1 というディレクトリを作成し、LANから読み書き可能にする。

# mkdir /samba-share
# mkdir /samba-share/dir1
# chmod 777 /samba-share/dir1
# nano /etc/samba/smb.conf

以下の内容を追加

# /samba-share/dir1
[Dir1]
path = /samba-share/dir1
writable = yes
create mode = 777
directory mode = 777
share modes = yes
guest ok = yes
guest only = yes

sambaの再起動

# /etc/init.d/samba restart



ユーザの追加

# adduser newuser
# pdbedit -a newuser
new password:
retype new password:

トップ   編集 凍結解除 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2012-05-16 (水) 23:39:40 (2708d)