2021/02/20作成, 2020/01/17更新

sambaをとりあえず動かすための単純設定

FreeBSD 12.1

pkg search samba
pkg install samba410

Ubuntu

apt search samba
apt install samba

smb.conf

セキュリティ的なことはいったん置いておいて、まずはsambaを動かす簡単な設定。

[global]
        workgroup=WORKGROUP
        security=user
        guest ok=yes
        guest account=nobody
        local master=no
        os level=0
        dns proxy=no
        wins support=no
        min protocol=SMB2
        max protocol=SMB3
        browseable=yes
        hosts allow=all
        server string=%h server
        dns proxy=no
        wins support=no

[homes]
        path=/home/%U
        browseable=no
        writable=yes
        read only=no

トラブルシューティング

IPアドレスでアクセスできるのに名前でアクセスできない

interfaces を使っていると発生する場合がある。原因はおそらく名前を引いたときにIPv6のアドレスが返っているの、interfacesがIPv4のものしか指定していないのではないかと。interfacesを削除するかinterfacesにIPv6の設定を追加する。

INTEL 小型ベアボーン BOXNUC8I5BEH
共有だけじゃなくていろいろとサーバーに仕事をさせたいならまずは場所を取らない小型PCを使ってみるのをお勧め。
Amazon.comのページを別ウィンドウで開きます
Synology DiskStation DS918+
ホットスワップ4ベイのNAS。RAIDも使えるし運用も簡単なのでおすすめ。
Amazon.comのページを別ウィンドウで開きます