openwrt:install-samba
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
openwrt:install-samba [2013/03/23 15:36] – [アクセスするユーザの追加] admin | openwrt:install-samba [2013/11/21 15:04] (現在) – [起動] admin | ||
---|---|---|---|
行 1: | 行 1: | ||
====== Samba のインストール ====== | ====== Samba のインストール ====== | ||
- | * OpenWrt: ATTITUDE ADJUSTMENT (12.09-rc1, r34185) | + | * OpenWrt: ATTITUDE ADJUSTMENT (12.09, |
- [[http:// | - [[http:// | ||
- | |||
===== パッケージをインストール ===== | ===== パッケージをインストール ===== | ||
行 16: | 行 15: | ||
# opkg update | # opkg update | ||
# opkg list | grep samba | # opkg list | grep samba | ||
- | luci-app-samba - 0.11+svn9425-1 - Network Shares - Samba SMB/CIFS module | + | luci-app-samba - 0.11.1-1 - Network Shares - Samba SMB/CIFS module |
- | samba36-client - 3.6.5-2 - Samba 3.6 SMB/CIFS client | + | samba36-client - 3.6.5-3 - Samba 3.6 SMB/CIFS client |
- | samba36-server - 3.6.5-2 - The Samba software suite is a collection of programs that implements the | + | samba36-server - 3.6.5-3 - The Samba software suite is a collection of programs that implements the SMB protocol for UNIX systems, allowing you to serve files and printers to Windows, NT, OS/2 and DOS clients. This protocol is sometimes also referred to as the LanManager or Netbios protocol. |
</ | </ | ||
行 25: | 行 24: | ||
< | < | ||
# opkg install samba36-server luci-app-samba | # opkg install samba36-server luci-app-samba | ||
- | Installing samba36-server (3.6.5-2) to root... | + | Installing samba36-server (3.6.5-3) to root... |
- | Downloading http:// | + | Downloading http:// |
- | Installing luci-app-samba (0.11+svn9425-1) to root... | + | Installing luci-app-samba (0.11.1-1) to root... |
- | Downloading http:// | + | Downloading http:// |
Configuring samba36-server. | Configuring samba36-server. | ||
Configuring luci-app-samba. | Configuring luci-app-samba. | ||
+ | </ | ||
+ | |||
+ | Samba を起動時に自動起動するように設定。 | ||
+ | |||
+ | < | ||
+ | # / | ||
+ | </ | ||
+ | |||
+ | Samba を起動。 | ||
+ | |||
+ | < | ||
+ | # / | ||
</ | </ | ||
行 41: | 行 52: | ||
< | < | ||
# vi /etc/passwd | # vi /etc/passwd | ||
- | |||
</ | </ | ||
- | nobody: | + | 以下の行を追加してユーザを新規作成する。(username は作成するユーザ名) |
- | username: | + | < |
- | + | username: | |
- | username: | + | </ |
^ username | ユーザー名 | | ^ username | ユーザー名 | | ||
^ * | ' | ^ * | ' | ||
^ 1000 | ユーザーID。1000 以上の既に使用されていない数値を選ぶ。 | | ^ 1000 | ユーザーID。1000 以上の既に使用されていない数値を選ぶ。 | | ||
- | ^ 65534 | グループID。ログインしないので、nobody と同じグループ | + | ^ 100 | グループID。users グループに所属させる。 | |
^ SambaUser | コメント。氏名や部署名等。| | ^ SambaUser | コメント。氏名や部署名等。| | ||
^ /var | ホームディレクトリを指定。ログインしないので、 /var を指定。 | | ^ /var | ホームディレクトリを指定。ログインしないので、 /var を指定。 | | ||
^ /bin/false | ユーザーのログインシェル。ログインしないので、 /bin/false を指定。 | | ^ /bin/false | ユーザーのログインシェル。ログインしないので、 /bin/false を指定。 | | ||
+ | |||
+ | users グループに追加する。 | ||
+ | |||
+ | < | ||
+ | # vi / | ||
+ | </ | ||
+ | < | ||
+ | root:x:0: | ||
+ | daemon:x:1: | ||
+ | adm:x:4: | ||
+ | mail:x:8: | ||
+ | audio:x:29: | ||
+ | www-data: | ||
+ | ftp:x:55: | ||
+ | users: | ||
+ | network: | ||
+ | nogroup: | ||
+ | </ | ||
+ | |||
+ | |||
+ | smbpasswd でユーザのパスワードを設定。新規の場合は -a オプションを付ける。変更の場合はオプションなし。 | ||
+ | |||
+ | < | ||
+ | # smbpasswd -a username | ||
+ | New SMB password: | ||
+ | Retype SMB password: | ||
+ | </ | ||
+ | |||
+ | |||
+ | 次は / | ||
+ | |||
+ | < | ||
+ | # vi / | ||
+ | </ | ||
+ | < | ||
+ | config samba | ||
+ | option ' | ||
+ | option ' | ||
+ | option ' | ||
+ | option ' | ||
+ | |||
+ | config ' | ||
+ | option ' | ||
+ | option ' | ||
+ | option ' | ||
+ | option ' | ||
+ | option ' | ||
+ | option ' | ||
+ | option ' | ||
+ | </ | ||
+ | |||
+ | |||
+ | Samba に設定ファイルを再読み込みさせる。 | ||
+ | |||
+ | < | ||
+ | # / | ||
+ | </ | ||
行 65: | 行 132: | ||
[[http:// | [[http:// | ||
+ | |||
+ | OpenWrt の Samba は設定ファイルが2つあるらしい。 | ||
+ | |||
+ | ^ / | ||
+ | ^ / | ||
+ | |||
+ | |||
+ | / | ||
+ | |||
+ | 次は / | ||
< | < | ||
- | # vi /etc/config/samba | + | # vi /etc/samba/ |
+ | </ | ||
+ | < | ||
+ | [global] | ||
+ | netbios name = |NAME| | ||
+ | display charset = UTF-8 | ||
+ | interfaces = |INTERFACES| | ||
+ | server string = |DESCRIPTION| | ||
+ | unix charset = UTF-8 | ||
+ | workgroup = |WORKGROUP| | ||
+ | browseable = yes | ||
+ | deadtime = 30 | ||
+ | domain master = yes | ||
+ | encrypt passwords = true | ||
+ | enable core files = no | ||
+ | guest account = nobody | ||
+ | guest ok = no | ||
+ | invalid users = root | ||
+ | local master = yes | ||
+ | load printers = no | ||
+ | map to guest = Bad User | ||
+ | max protocol = SMB2 | ||
+ | min receivefile size = 16384 | ||
+ | null passwords = no | ||
+ | obey pam restrictions = yes | ||
+ | os level = 20 | ||
+ | passdb backend = smbpasswd | ||
+ | preferred master = yes | ||
+ | printable = no | ||
+ | security = user | ||
+ | smb encrypt = disabled | ||
+ | smb passwd file = /etc/samba/ | ||
+ | socket options = TCP_NODELAY IPTOS_LOWDELAY | ||
+ | syslog = 2 | ||
+ | use sendfile = yes | ||
+ | writeable = yes | ||
</ | </ | ||
+ | 変更部分は以下。 | ||
+ | |||
+ | ^ display charset = UTF-8 | 日本語のファイル名も扱えるように UTF8 を使用。 | | ||
+ | ^ unix charset = UTF-8 | 日本語のファイル名も扱えるように UTF8 を使用。 | | ||
+ | ^ guest ok = no | guest ユーザはすべて不許可に変更。 | | ||
+ | ^ null passwords = no | すべてのユーザにパスワード認証を要求するように変更。 | | ||
+ | |||
+ | |||
+ | ===== 起動 ===== | ||
+ | |||
+ | Samba を再起動し設定ファイルを再読み込みする。 | ||
+ | |||
+ | < | ||
+ | # / | ||
+ | </ | ||
openwrt/install-samba.1364020589.txt.gz · 最終更新: 2013/03/23 15:36 by admin