openwrt:install-samba
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
openwrt:install-samba [2013/03/23 16:02] – [アクセスするユーザの追加] 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 を起動。 | ||
+ | |||
+ | < | ||
+ | # / | ||
</ | </ | ||
行 46: | 行 57: | ||
< | < | ||
- | username: | + | username: |
</ | </ | ||
行 52: | 行 63: | ||
^ * | ' | ^ * | ' | ||
^ 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: | ||
+ | </ | ||
行 62: | 行 92: | ||
< | < | ||
# smbpasswd -a username | # smbpasswd -a username | ||
- | Failed to open / | + | New SMB password: |
+ | Retype SMB password: | ||
</ | </ | ||
- | あれ〜?エラーが出る。パスワードファイルが無いみたいだけど、一回も起動したことがないから? | ||
- | |||
- | ではとりあえず一回起動してみるか。 | ||
- | とりえあず | + | 次は |
< | < | ||
行 75: | 行 103: | ||
</ | </ | ||
< | < | ||
- | config | + | config samba |
- | option ' | + | option ' |
- | option ' | + | |
- | option 'workgroup' 'WORKGROUP' | + | |
+ | option 'homes' | ||
config ' | config ' | ||
- | option 'read_only' 'no' | + | |
- | option 'create_mask' '0755' | + | option 'path' '/ |
- | option 'dir_mask' '0755' | + | option 'users' 'username' |
- | option 'name' 'Samba Share' | + | option 'guest_ok' 'no' |
- | option 'path' '/ | + | option 'create_mask' '0755' |
- | option 'guest_ok' ' | + | option 'dir_mask' |
+ | option ' | ||
</ | </ | ||
- | Samba 起動。 | ||
- | < | + | Samba に設定ファイルを再読み込みさせる。 |
- | # / | + | |
- | </ | + | |
< | < | ||
- | # smbpasswd -a username | + | # / |
- | New SMB password: | + | |
- | Retype SMB password: | + | |
</ | </ | ||
- | 今度はパスワードの設定ができた。 | + | |
===== 設定 ===== | ===== 設定 ===== | ||
行 107: | 行 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 を使用。 | |
- | config ' | + | ^ unix charset = UTF-8 | 日本語のファイル名も扱えるように UTF8 を使用。 | |
- | option ' | + | ^ guest ok = no | guest ユーザはすべて不許可に変更。 | |
- | option ' | + | ^ null passwords = no | すべてのユーザにパスワード認証を要求するように変更。 | |
- | option ' | + | |
- | config ' | + | |
- | option ' | + | ===== 起動 ===== |
- | option ' | + | |
- | option ' | + | Samba を再起動し設定ファイルを再読み込みする。 |
- | option ' | + | |
- | option ' | + | < |
- | option ' | + | # /etc/init.d/samba restart |
</ | </ | ||
+ | |||
+ |
openwrt/install-samba.1364022160.txt.gz · 最終更新: 2013/03/23 16:02 by admin