jph@HEFFSVR2:~$ sudo apt-get install samba --install-recommends 正在读取软件包列表...完成 正在构建依赖关系树
正在读取状态信息...完成 samba 已经是最新版本 (2:4.11.6+dfsg-0ubuntu1.6)。升级了 0 个软件包,新安装了 0 个软件包,要删除 0 个软件包,未升级 58 个软件包。
以下是 jph@HEFFSVR2 的结果:~$ journalctl -xe
Nov 29 15:57:44 HEFFSVR2 smartd[1761]: Device: /dev/sdd [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 115 to 114
Nov 29 15:57:44 HEFFSVR2 smartd[1761]: Device: /dev/sde [SAT], SMART Prefailure Attribute: 1 Raw_Read_Error_Rate changed from 120 to 114
Nov 29 15:57:45 HEFFSVR2 smartd[1761]: Device: /dev/sdf [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 114 to 113
Nov 29 15:57:45 HEFFSVR2 smartd[1761]: Device: /dev/sdg [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 115 to 114
Nov 29 15:59:15 HEFFSVR2 systemd[1]: fwupd.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit fwupd.service has successfully entered the 'dead' state.
Nov 29 15:59:28 HEFFSVR2 sudo[2207637]: jph : TTY=pts/0 ; PWD=/home/jph ; USER=root ; COMMAND=/usr/bin/apt-get install samba --install-recommends
Nov 29 15:59:28 HEFFSVR2 sudo[2207637]: pam_unix(sudo:session): session opened for user root by (uid=0)
Nov 29 15:59:29 HEFFSVR2 sudo[2207637]: pam_unix(sudo:session): session closed for user root
Nov 29 16:00:43 HEFFSVR2 sudo[2401851]: jph : TTY=pts/0 ; PWD=/home/jph ; USER=root ; COMMAND=/usr/bin/gedit /etc/samba/smb.conf.backup
Nov 29 16:00:43 HEFFSVR2 sudo[2401851]: pam_unix(sudo:session): session opened for user root by (uid=0)
Nov 29 16:00:43 HEFFSVR2 smbd[2246740]: pam_unix(samba:session): session closed for user nobody
Nov 29 16:00:43 HEFFSVR2 gnome-shell[2624]: Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x3c000f5
Nov 29 16:00:52 HEFFSVR2 sudo[2401851]: pam_unix(sudo:session): session closed for user root
Nov 29 16:01:00 HEFFSVR2 sudo[2449249]: jph : TTY=pts/0 ; PWD=/home/jph ; USER=root ; COMMAND=/usr/bin/gedit /etc/samba/smb.conf
Nov 29 16:01:00 HEFFSVR2 sudo[2449249]: pam_unix(sudo:session): session opened for user root by (uid=0)
Nov 29 16:01:01 HEFFSVR2 gnome-shell[2624]: Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x3c000f5
Nov 29 16:01:09 HEFFSVR2 /usr/lib/gdm3/gdm-x-session[2473]: (EE) client bug: timer event3 debounce short: scheduled expiry is in the past (-1ms), your system is too slow
Nov 29 16:01:11 HEFFSVR2 sudo[2449249]: pam_unix(sudo:session): session closed for user root
Nov 29 16:01:18 HEFFSVR2 systemd-resolved[1693]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Nov 29 16:01:32 HEFFSVR2 sudo[2533037]: jph : TTY=pts/0 ; PWD=/home/jph ; USER=root ; COMMAND=/usr/bin/gedit /etc/samba/smb.conf
Nov 29 16:01:32 HEFFSVR2 sudo[2533037]: pam_unix(sudo:session): session opened for user root by (uid=0)
Nov 29 16:01:32 HEFFSVR2 gnome-shell[2624]: Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x3c000f5
Nov 29 16:01:39 HEFFSVR2 sudo[2533037]: pam_unix(sudo:session): session closed for user root
Nov 29 16:01:50 HEFFSVR2 sudo[2581161]: jph : TTY=pts/0 ; PWD=/home/jph ; USER=root ; COMMAND=/usr/sbin/service smdb restart
Nov 29 16:01:50 HEFFSVR2 sudo[2581161]: pam_unix(sudo:session): session opened for user root by (uid=0)
Nov 29 16:01:50 HEFFSVR2 sudo[2581161]: pam_unix(sudo:session): session closed for user root
jph@HEFFSVR2:~$ sudo service smdb restart 无法重新启动 smdb.service:未找到单元 smdb.service。
这是我的 jph@HEFFSVR2:~$ sudo gedit /etc/samba/smb.conf
[global]
passdb backend = tdbsam
security = user
usershare owner only = false
workgroup = WORKGROUP
server string = %h server (Samba, Ubuntu)
interfaces = 192.168.1.73 eth0
bind interfaces only = yes
log file = /var/log/samba/log.%m
max log size = 1000
logging = file
panic action = /usr/share/samba/panic-action %d
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
force user = jph
usershare allow guests = yes
[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
[Users]
path = /heffpool/udata
browseable = yes
read only = no
force create mode = 0660
force directory mode = 2770
valid users = jph
[homes]
comment = Home Directories
browseable = yes
read only = no
create mask = 0700
directory mask = 0700
valid users = %S
[public]
comment = public anonymous access
path = /heffpool/udata
browsable =yes
create mask = 0660
directory mask = 0771
writable = yes
guest ok = yes
答案1
我通过使用以下命令重新安装服务器解决了这个问题:
sudo apt-get install samba samba-common-bin