LoginSignup
1
1

More than 3 years have passed since last update.

OpenWRT(LEDE)使いこなし : NASとしてsamba共有するまで

Posted at

はじめに

OpenWRT/LEDEはワイヤレスルーター向けのLinuxディストリビューションですが、
NASとして運用する場合のTipsとして、
samba設定について情報を残しておきます。

尚、中華NASキットBS-U35WFにOpenWRT/LEDEをインストールするまでのTipsは以下です。

参考 :

samba install

基本的にほげぴよさんのwikiの通りです。
違いと言えば、Webインターフェース luci-app の日本語版を入れたくらいです。

root@LEDE:~# opkg list | grep samba
luci-app-samba - git-19.271.72080-7b230b0-1 - Network Shares - Samba SMB/CIFS module
・・・
luci-i18n-samba-ja - git-19.271.72080-7b230b0-1 - Translation for luci-app-samba - 日本語 (Japanese)
・・・
samba36-client - 3.6.25-8 - Samba 3.6 SMB/CIFS client
samba36-server - 3.6.25-8 - 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.

root@LEDE:~# opkg install samba36-server luci-app-samba luci-i18n-samba-ja

home作成

openWRT/LEDEは、標準では /home すら作られていない為、作成します。

root@LEDE:/# cd /mnt/sda1
root@LEDE:/mnt/sda1# mkdir home
root@LEDE:/# ln -s /mnt/sda1/home/ /home

上手くsambaへ繋がらない場合

私の場合、sambaが正しく起動しても、外部から上手く接続できませんでした。
結論としては、/etc/samba/smb.conf ではなく、
/etc/samba/smb.conf.template を修正する必要があります。

/etc/samba/smb.conf.template
root@LEDE:~# vi /etc/samba/smb.conf.template
      interfaces = |INTERFACES|
↓
#      interfaces = |INTERFACES|
    bind interfaces only = no

ゲストアカウント追加

家庭内NAS運用の場合、家族の共有ディレクトリを運用する場合等は、ゲストアカウントで運用します。

/etc/samba/smb.conf.template
    guest account = nobody

シンボリックリンク対策

公開ディレクトリからシンボリックリンクを辿りたい場合は、
以下の設定が必要です。

/etc/samba/smb.conf.template
    unix extensions = no
    wide links = yes

luci-appからの設定

ここまでの/etc/samba/smb.conf.templateに対する設定は、
GUIのluci-app経由からも設定出来ます。
image.png

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1