私はこれを達成しようとしてきました。
- 次のSamba設定ファイルを使用してください。
.config/smb.conf
そして
- 以下のサービス構成ファイル
.config/systemd/user/smbd.service
そして
- 走る
systemctl --user start smbd.service
ただし、状態が失敗してsystemctl --user status smbd.service
orで取得されるのは次のとおりです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
必要に応じて、サービス単位のユーザープロファイルを追加できます。どんなアイデアがありますか?