linux:samba:setting

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
linux:samba:setting [2022/05/29 02:00] – [Samba の設定] ともやんlinux:samba:setting [2022/05/29 03:53] (現在) – [参考文献] ともやん
行 265: 行 265:
     wide links = yes     wide links = yes
 </code> </code>
 +</WRAP>
 +
 +DietPi の設定例\\
 +<WRAP prewrap 100% mincode_long>
 +<code autoconf /etc/samba/smb.conf>
 +[global]
 +    unix extensions = no
 +
 +    # UIDとGIDについてUNIX属性の値が反映されるようにする
 +    #idmap_ldb:use rfc2307 = yes
 +
 +    # Samba 高速化
 +    #socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 SO_KEEPALIVE
 +    socket options = TCP_NODELAY SO_KEEPALIVE TCP_KEEPIDLE=120 TCP_KEEPINTVL=10 TCP_KEEPCNT=5
 +    #max protocol = SMB2
 +#    workgroup = WORKGROUP
 +    workgroup = MONSTERS-G
 +    server string = %h server
 +    dns proxy = no
 +    log file = /var/log/samba/log.%m
 +    max log size = 1000
 +    syslog only = no
 +    syslog = 0
 +
 +    panic action = /usr/share/samba/panic-action %d
 +
 +    security = user
 +    encrypt passwords = true
 +    passdb backend = tdbsam
 +    obey pam restrictions = yes
 +    unix password sync = yes
 +
 +    passwd program = /usr/bin/passwd %u
 +    passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
 +    pam password change = yes
 +    map to guest = bad user
 +
 +    load printers = no
 +    printcap name = /dev/null
 +    disable spoolss = yes
 +
 +[homes]
 +   comment = Home Directories
 +#   browseable = no
 +   browseable = yes
 +#   read only = yes
 +   read only = no
 +
 +[DataShare]
 +    comment = Data Share
 +    path = /var/samba/DataShare
 +    browseable = yes
 +    read only = no
 +    wide links = yes
 +
 +[dietpi]
 +    comment = DietPi Share
 +    path = /mnt/dietpi_userdata
 +    browseable = yes
 +    create mask = 0664
 +    directory mask = 0775
 +    valid users = dietpi
 +    writeable = yes
 +    max connections = 2
 +</code>
 +</WRAP>
 +
 +===== トラブルシューティング =====
 +
 +==== smb.conf に wide links = yes を設定するとファイル共有にアクセスできない😥 ====
 +<WRAP mincode>
 +<code autoconf /etc/samba/smb.conf>
 +
 +#### Debugging/Accounting ####
 +
 +# This tells Samba to use a separate log file for each machine
 +# that connects
 +   log file = /var/log/samba/log.%m
 +
 +[DataShare]
 +    comment = Data Share
 +    path = /var/samba/DataShare
 +    browseable = yes
 +    read only = no
 +    wide links = yes
 +</code>
 +</WRAP>
 +
 +samba のログを確認する🤔\\
 +<WRAP color_term>
 +<WRAP color_command><code>
 +$ sudo tail -f /var/log/samba/log.risky
 +</code></WRAP>
 +<WRAP color_result><html><pre>
 +<b class=RED>[2022/05/29 03:22:00.685617,  0] ../../source3/smbd/service.c:636(make_connection_snum)
 +  make_connection_snum: vfs_init failed for service DataShare
 +[2022/05/29 03:22:00.689388,  0] ../../lib/util/modules.c:49(load_module)
 +  Error loading module '/usr/lib/arm-linux-gnueabihf/samba/vfs/widelinks.so': /usr/lib/arm-linux-gnueabihf/samba/vfs/widelinks.so: cannot open shared object file: No such file or directory
 +[2022/05/29 03:22:00.689613,  0] ../../source3/smbd/vfs.c:185(vfs_init_custom)
 +  error probing vfs module 'widelinks': NT_STATUS_UNSUCCESSFUL
 +[2022/05/29 03:22:00.689764,  0] ../../source3/smbd/vfs.c:379(smbd_vfs_init)
 +  smbd_vfs_init: widelinks enabled and vfs_init_custom failed for vfs_widelinks module
 +[2022/05/29 03:22:00.689898,  0] ../../source3/smbd/service.c:636(make_connection_snum)
 +  make_connection_snum: vfs_init failed for service DataShare</b>
 +</pre></html></WRAP>
 +</WRAP>
 +**widelinks.so** が見つからないのでモジュールがロード出来ていない😱\\
 +
 +**widelinks.so** は **samba-vfs-modules** パッケージに含まれる。\\
 +<WRAP color_term>
 +<WRAP color_command><code>
 +$ apt-file search widelinks.so
 +</code></WRAP>
 +<WRAP color_result><code>
 +samba-vfs-modules: /usr/lib/arm-linux-gnueabihf/samba/vfs/widelinks.so
 +</code></WRAP>
 +</WRAP>
 +
 +**samba-vfs-modules** パッケージをインストールするとファイル共有にアクセス可能になる🥰\\
 +<WRAP color_term>
 +<WRAP color_command><code>
 +$ sudo apt install samba-vfs-modules
 +</code></WRAP>
 +<WRAP color_result><code>
 +Reading package lists... Done
 +Building dependency tree... Done
 +Reading state information... Done
 +The following additional packages will be installed:
 +  liburing1
 +Recommended packages:
 +  libcephfs2 libgfapi0
 +The following NEW packages will be installed:
 +  liburing1 samba-vfs-modules
 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
 +Need to get 466 kB of archives.
 +After this operation, 1,549 kB of additional disk space will be used.
 +Do you want to continue? [Y/n] y
 +Get:1 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian bullseye/main armhf liburing1 armhf 0.7-3 [7,708 B]
 +Get:2 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf samba-vfs-modules armhf 2:4.13.13+dfsg-1~deb11u3 [458 kB]
 +Fetched 466 kB in 3s (166 kB/s)
 +debconf: delaying package configuration, since apt-utils is not installed
 +Selecting previously unselected package liburing1:armhf.
 +(Reading database ... 70828 files and directories currently installed.)
 +Preparing to unpack .../liburing1_0.7-3_armhf.deb ...
 +Unpacking liburing1:armhf (0.7-3) ...
 +Selecting previously unselected package samba-vfs-modules:armhf.
 +Preparing to unpack .../samba-vfs-modules_2%3a4.13.13+dfsg-1~deb11u3_armhf.deb ...
 +Unpacking samba-vfs-modules:armhf (2:4.13.13+dfsg-1~deb11u3) ...
 +Setting up liburing1:armhf (0.7-3) ...
 +Setting up samba-vfs-modules:armhf (2:4.13.13+dfsg-1~deb11u3) ...
 +Processing triggers for libc-bin (2.31-13+rpt2+rpi1+deb11u2) ...
 +</code></WRAP>
 </WRAP> </WRAP>
  
  • linux/samba/setting.1653757217.txt.gz
  • 最終更新: 2022/05/29 02:00
  • by ともやん