samba設定ファイルの見本

samba設定ファイル/etc/samba/smb.confの見本

https://tm23forest.com/contents/samba-configuration-sample

Ubuntuでファイル共有サーバsambaをインストールしてセットアップする際に編集する/etc/samba/smb.confの例を示す。

完全なリファレンスは以下にある。

https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html

デフォルトの設定ファイルは/etc/samba/smb.confにある。これを編集・追記してsmbdをsystemctlなどを用いて再起動する。

[global]
# charset
dos charset = CP932
unix charset = UTF-8

# by default
security = user

# bind interfaces
interfaces = eth0
bind interfaces only = yes

[share] #arbitrary label 1
path = /mnt/share
comment = /mnt/share is here
writable = yes
browsable = false
guest ok = yes
guest only = yes
create mode = 0777
directory mode = 0777

[readonly] #arbitrary label 2
path = /mnt/readonly
comment = /mnt/readonly is here
read only = yes
browsable = yes
guest ok = yes
guest only = yes

[home] #arbitrary label 3
path = /home
guest ok = no
valid users = user, fuger, hoger, suher
browsable = no
writable = yes
share modes = yes
create mode = 0664
directory mode = 0755
以上のように設定する。もちろん中略多数である。ある程度の察し力があればそれぞれの意味は説明不要だろう。

Linux、Netatalk、Samba、NFSを使用したファイルサーバーについて研究・運用しています。

fsをフォローする
参考リンク

コメント