使用用户配置运行 sambashare

使用用户配置运行 sambashare

我一直在努力实现这一目标:

  1. 使用下面的 samba 配置文件.config/smb.conf

  1. 下的服务配置文件.config/systemd/user/smbd.service

  1. 跑步systemctl --user start smbd.service

然而状态失败了,我从systemctl --user status smbd.serviceor得到的只是journalctl --user --e

May 22 15:26:48 localhost.localdomain smbd[19674]: [2021/05/22 15:26:48.756294,  0] ../../lib/util/debug.c:1098(reopen_one_log)
May 22 15:26:48 localhost.localdomain smbd[19674]:   reopen_one_log: Unable to open new log file '/var/log/samba/log.smbd': Permission denied
May 22 15:26:48 localhost.localdomain smbd[19674]: [2021/05/22 15:26:48.756339,  0] ../../source3/smbd/server.c:1775(main)
May 22 15:26:48 localhost.localdomain smbd[19674]:   smbd version 4.11.6-Ubuntu started.
May 22 15:26:48 localhost.localdomain smbd[19674]:   Copyright Andrew Tridgell and the Samba Team 1992-2019
May 22 15:26:48 localhost.localdomain systemd[1582]: smbd.service: Main process exited, code=exited, status=1/FAILURE
May 22 15:26:48 localhost.localdomain systemd[1582]: smbd.service: Failed with result 'exit-code'.
May 22 15:26:48 localhost.localdomain systemd[1582]: smbd.service: Scheduled restart job, restart counter is at 5.
May 22 15:26:48 localhost.localdomain systemd[1582]: Stopped Samba SMB Daemon.
May 22 15:26:48 localhost.localdomain systemd[1582]: smbd.service: Start request repeated too quickly.
May 22 15:26:48 localhost.localdomain systemd[1582]: smbd.service: Failed with result 'exit-code'.
May 22 15:26:48 localhost.localdomain systemd[1582]: Failed to start Samba SMB Daemon.

我知道这一行May 22 15:26:48 localhost.localdomain smbd[19674]: reopen_one_log: Unable to open new log file '/var/log/samba/log.smbd': Permission denied,但我不知道它来自哪里,因为 samba 配置文件清楚地表明了$HOME/logs/samba/log.%m.

为了完整起见,我粘贴配置文件:

[global]

   workgroup = sm
   client min protocol = NT1
   server string = %h server (Samba, Ubuntu)

#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects
   log file = $HOME/logs/samba/log.%m
   max log size = 1000
   logging = file

# Do something sensible when Samba crashes: mail the admin a backtrace
   panic action = /usr/share/samba/panic-action %d

####### Authentication #######

   server role = standalone server
   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
   usershare allow guests = yes


[sambashare]
    comment = Samba on Ubuntu
    path = /home/sm/samba
    read only = no
    browsable = yes
    directory mask = 0755

如有必要,我可以添加服务单元的用户配置文件。任何想法?

相关内容