https://teratail.com/questions/362661
Samba の共有ディレクトリでのパーミッション
Ubuntu 20.04 に Samba を導入しました。共有のためのディレクトリを作成してパーミッションを設定、Samba で共有しています。
許可されたユーザのみがアクセスできるように、共有ディレクトリのパーミッションを 2775 にして、このディレクトリを使用するユーザを users グループに追加しています。具体的には、
shell
$ pwd
/home/export
$ ls -la
total 36
drwxrwsr-x 4 sysadmin users 4096 Oct 4 13:11 .
drwxr-xr-x 5 root root 4096 Oct 4 10:44 ..
という感じになっています。ユーザ hoge を users グループに追加して pdbedit で hoge で Samba を使えるようにしました($ pdbedit -a hoge)。Ubuntu のターミナルでこのディレクトリに入って新たにディレクトリをつくると、
shell
$ ls -l
total 16
drwxrwsr-x 2 hoge users 4096 Oct 4 13:24 hoge-dir
と期待した通りに動作しています。ここで Windows と MacOS からこの Samba サーバにアクセスして、ディレクトリをつくると、
shell
$ ls -l
total 36
drwxr-xr-x+ 2 hoge users 4096 Oct 4 13:11 Mac
drwxrwsr-x 2 hoge users 4096 Oct 4 13:11 Win
と Windows で作成したディレクトリは期待したパーミッションなんですが、MacOS で作成したディレクトリは 755 になってしまいます。MacOS で作成したディレクトリを Windows で作成したディレクトリと同じパーミッションにするにはどうしたら良いでしょうか?
MacOS でローカルにフォルダをつくると、パーミッションが 755 になりますが、755 でつくるということでどうしようもないのですかね?
/etc/samba/smb.conf
[global]
disable spoolss = Yes
dos charset = CP932
load printers = No
log file = /var/log/samba/log.%m
logging = file
max log size = 1000
obey pam restrictions = Yes
pam password change = Yes
panic action = /usr/share/samba/panic-action %d
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
passwd program = /usr/bin/passwd %u
security = USER
server role = standalone server
server string = %h server (Samba, Ubuntu)
unix password sync = Yes
usershare allow guests = Yes
idmap config * : backend = tdb
[Export]
comment = Shared Folder
create mask = 0664
directory mask = 0775
path = /home/export
read only = No
valid users = @users
vfs objects = catia fruit streams_xattr

コメント