我家里有一台运行着 Ubuntu 的机器,它有几个 samba 共享。我把它用在我的 Windows 10 游戏电脑上,它运行完美。但是,在我的联想电脑上,它却不行。实际上,它以前可以运行,但是当我安装一个全新的 Windows 10 时,它却无法运行。最近,经过几个月的不工作,我决定全新安装 Windows 11,但它仍然给出同样的错误。
我可以从 CMD 使用 SSH 访问 Ubuntu 机器(或者甚至可以使用 filezilla 使用 SFTP)。
这是我的 smb.conf 的内容
#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
# - When such options are commented with ";", the proposed setting
# differs from the default Samba behaviour
# - When commented with "#", the proposed setting is the default
# behaviour of Samba but the option is considered important
# enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic
# errors.
#======================= Global Settings =======================
[global]
client min protocol = SMB2
client max protocol = SMB3
protocol = SMB3
client ntlmv2 auth = yes
## Browsing/Identification ###
# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = WORKGROUP
# server string is the equivalent of the NT Description field
server string = %h server (Samba, Ubuntu)
# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
# wins support = no
# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = w.x.y.z
# This will prevent nmbd to search for NetBIOS names through DNS.
dns proxy = no
#### Networking ####
# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
; interfaces = 127.0.0.0/8 eth0
# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself. However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
; bind interfaces only = yes
#### Debugging/Accounting ####
# This tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/log.%m
log level = 3
# Cap the size of the individual log files (in KiB).
max log size = 1000
# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
# syslog only = no
# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.
syslog = 0
# Do something sensible when Samba crashes: mail the admin a backtrace
panic action = /usr/share/samba/panic-action %d
####### Authentication #######
# Server role. Defines in which mode Samba will operate. Possible
# values are "standalone server", "member server", "classic primary
# domain controller", "classic backup domain controller", "active
# directory domain controller".
#
# Most people will want "standalone sever" or "member server".
# Running as "active directory domain controller" will require first
# running "samba-tool domain provision" to wipe databases and create a
# new domain.
server role = standalone server
# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.
passdb backend = tdbsam
obey pam restrictions = yes
# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
unix password sync = yes
# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<[email protected]> for
# sending the correct chat script for the passwd program in Debian Sarge).
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
pam password change = yes
# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
; map to guest = bad user
########## Domains ###########
#
# The following settings only takes effect if 'server role = primary
# classic domain controller', 'server role = backup domain controller'
# or 'domain logons' is set
#
# It specifies the location of the user's
# profile directory from the client point of view) The following
# required a [profiles] share to be setup on the samba server (see
# below)
; logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
# (this is Samba's default)
# logon path = \\%N\%U\profile
# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
; logon drive = H:
# logon home = \\%N\%U
# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
; logon script = logon.cmd
# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe. The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u
# This allows machine accounts to be created on the domain controller via the
# SAMR RPC pipe.
# The following assumes a "machines" group exists on the system
; add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u
# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe.
; add group script = /usr/sbin/addgroup --force-badname %g
############ Misc ############
# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /home/samba/etc/smb.conf.%m
# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
; idmap uid = 10000-20000
; idmap gid = 10000-20000
; template shell = /bin/bash
# Setup usershare options to enable non-root users to share folders
# with the net usershare command.
# Maximum number of usershare. 0 (default) means that usershare is disabled.
; usershare max shares = 100
# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
usershare allow guests = yes
#======================= Share Definitions =======================
# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user's home directory as \\server\username
;[homes]
; comment = Home Directories
; browseable = no
# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
; read only = yes
# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
; create mask = 0700
# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
; directory mask = 0700
# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# Un-comment the following parameter to make sure that only "username"
# can connect to \\server\username
# This might need tweaking when using external authentication schemes
; valid users = %S
# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; read only = yes
# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
; comment = Users profiles
; path = /home/samba/profiles
; guest ok = no
; browseable = no
; create mask = 0600
; directory mask = 0700
[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700
# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
; write list = root, @lpadmin
[DISK1]
path = /media/DISK1
valid users = sambauser
read only = no
browseable = yes
[DISK2]
path = /media/DISK2
valid users = sambauser
read only = no
[DISK3]
path = /media/DISK3
valid users = sambauser
read only = no
以下是我尝试连接时的 Samba 日志:
[2022/04/10 11:28:26.631326, 3] ../source3/smbd/oplock.c:1340(init_oplocks)
init_oplocks: initializing messages.
[2022/04/10 11:28:26.631456, 3] ../source3/smbd/process.c:1959(process_smb)
Transaction 0 of length 288 (0 toread)
[2022/04/10 11:28:26.631854, 3] ../source3/smbd/smb2_negprot.c:290(smbd_smb2_request_process_negprot)
Selected protocol SMB3_11
[2022/04/10 11:28:26.635684, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'gssapi_spnego' registered
[2022/04/10 11:28:26.635698, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'gssapi_krb5' registered
[2022/04/10 11:28:26.635704, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'gssapi_krb5_sasl' registered
[2022/04/10 11:28:26.635715, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'spnego' registered
[2022/04/10 11:28:26.635721, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'schannel' registered
[2022/04/10 11:28:26.635731, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'naclrpc_as_system' registered
[2022/04/10 11:28:26.635737, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'sasl-EXTERNAL' registered
[2022/04/10 11:28:26.635742, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'ntlmssp' registered
[2022/04/10 11:28:26.635748, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'ntlmssp_resume_ccache' registered
[2022/04/10 11:28:26.635753, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'http_basic' registered
[2022/04/10 11:28:26.635759, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'http_ntlm' registered
[2022/04/10 11:28:26.635764, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'krb5' registered
[2022/04/10 11:28:26.635770, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'fake_gssapi_krb5' registered
[2022/04/10 11:28:26.638084, 3] ../auth/ntlmssp/ntlmssp_util.c:69(debug_ntlmssp_flags)
Got NTLMSSP neg_flags=0xe2088297
[2022/04/10 11:28:26.640206, 3] ../auth/ntlmssp/ntlmssp_server.c:454(ntlmssp_server_preauth)
Got user=[sambauser] domain=[MicrosoftAccount] workstation=[LENOVO-YOGA-730] len1=24 len2=238
[2022/04/10 11:28:26.640237, 3] ../source3/param/loadparm.c:3866(lp_load_ex)
lp_load_ex: refreshing parameters
[2022/04/10 11:28:26.640267, 3] ../source3/param/loadparm.c:549(init_globals)
Initialising global parameters
[2022/04/10 11:28:26.640308, 3] ../source3/param/loadparm.c:2780(lp_do_section)
Processing section "[global]"
[2022/04/10 11:28:26.640358, 1] ../lib/param/loadparm.c:1823(lpcfg_do_global_parameter)
WARNING: The "syslog" option is deprecated
[2022/04/10 11:28:26.640421, 2] ../source3/param/loadparm.c:2797(lp_do_section)
Processing section "[printers]"
[2022/04/10 11:28:26.640453, 2] ../source3/param/loadparm.c:2797(lp_do_section)
Processing section "[print$]"
[2022/04/10 11:28:26.640474, 2] ../source3/param/loadparm.c:2797(lp_do_section)
Processing section "[WD_12TB]"
[2022/04/10 11:28:26.640496, 2] ../source3/param/loadparm.c:2797(lp_do_section)
Processing section "[Seagate_8TB]"
[2022/04/10 11:28:26.640515, 2] ../source3/param/loadparm.c:2797(lp_do_section)
Processing section "[Seagate_5TB]"
[2022/04/10 11:28:26.640535, 2] ../source3/param/loadparm.c:2797(lp_do_section)
Processing section "[TorrentBox]"
[2022/04/10 11:28:26.640555, 2] ../source3/param/loadparm.c:2797(lp_do_section)
Processing section "[WD_EXT]"
[2022/04/10 11:28:26.640581, 3] ../source3/param/loadparm.c:1615(lp_add_ipc)
adding IPC service
[2022/04/10 11:28:26.640594, 3] ../source3/auth/auth.c:189(auth_check_ntlm_password)
check_ntlm_password: Checking password for unmapped user [MicrosoftAccount]\[sambauser]@[LENOVO-YOGA-730] with the new password interface
[2022/04/10 11:28:26.640600, 3] ../source3/auth/auth.c:192(auth_check_ntlm_password)
check_ntlm_password: mapped user is: [MicrosoftAccount]\[sambauser]@[LENOVO-YOGA-730]
[2022/04/10 11:28:26.640650, 3] ../source3/auth/check_samsec.c:399(check_sam_security)
check_sam_security: Couldn't find user 'sambauser' in passdb.
[2022/04/10 11:28:26.640660, 2] ../source3/auth/auth.c:332(auth_check_ntlm_password)
check_ntlm_password: Authentication for user [sambauser] -> [sambauser] FAILED with error NT_STATUS_NO_SUCH_USER, authoritative=1
[2022/04/10 11:28:26.640681, 2] ../auth/auth_log.c:760(log_authentication_event_human_readable)
Auth: [SMB2,(null)] user [MicrosoftAccount]\[sambauser] at [Sun, 10 Apr 2022 11:28:26.640676 -03] with [NTLMv2] status [NT_STATUS_NO_SUCH_USER] workstation [LENOVO-YOGA-730] remote host [ipv4:192.168.0.103:51309] mapped to [MicrosoftAccount]\[sambauser]. local host [ipv4:192.168.0.136:445]
[2022/04/10 11:28:26.640732, 2] ../auth/auth_log.c:220(log_json)
JSON Authentication: {"timestamp": "2022-04-10T11:28:26.640702-0300", "type": "Authentication", "Authentication": {"version": {"major": 1, "minor": 0}, "status": "NT_STATUS_NO_SUCH_USER", "localAddress": "ipv4:192.168.0.136:445", "remoteAddress": "ipv4:192.168.0.103:51309", "serviceDescription": "SMB2", "authDescription": null, "clientDomain": "MicrosoftAccount", "clientAccount": "sambauser", "workstation": "LENOVO-YOGA-730", "becameAccount": null, "becameDomain": null, "becameSid": "(NULL SID)", "mappedAccount": "sambauser", "mappedDomain": "MicrosoftAccount", "netlogonComputer": null, "netlogonTrustAccount": null, "netlogonNegotiateFlags": "0x00000000", "netlogonSecureChannelType": 0, "netlogonTrustAccountSid": "(NULL SID)", "passwordType": "NTLMv2"}}
[2022/04/10 11:28:26.640749, 2] ../auth/gensec/spnego.c:605(gensec_spnego_server_negTokenTarg)
SPNEGO login failed: NT_STATUS_NO_SUCH_USER
[2022/04/10 11:28:26.640779, 3] ../source3/smbd/smb2_server.c:3139(smbd_smb2_request_error_ex)
smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_LOGON_FAILURE] || at ../source3/smbd/smb2_sesssetup.c:134
[2022/04/10 11:28:26.642716, 3] ../source3/smbd/server_exit.c:244(exit_server_common)
Server exit (NT_STATUS_CONNECTION_RESET)
从我的另一台 Windows 计算机登录,表明我可以成功访问 samba 共享:
[2022/04/10 14:46:02.820691, 3] ../source3/smbd/oplock.c:1340(init_oplocks)
init_oplocks: initializing messages.
[2022/04/10 14:46:02.820827, 3] ../source3/smbd/process.c:1959(process_smb)
Transaction 0 of length 256 (0 toread)
[2022/04/10 14:46:02.821334, 3] ../source3/smbd/smb2_negprot.c:290(smbd_smb2_request_process_negprot)
Selected protocol SMB3_11
[2022/04/10 14:46:02.825028, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'gssapi_spnego' registered
[2022/04/10 14:46:02.825043, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'gssapi_krb5' registered
[2022/04/10 14:46:02.825050, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'gssapi_krb5_sasl' registered
[2022/04/10 14:46:02.825056, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'spnego' registered
[2022/04/10 14:46:02.825062, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'schannel' registered
[2022/04/10 14:46:02.825068, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'naclrpc_as_system' registered
[2022/04/10 14:46:02.825074, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'sasl-EXTERNAL' registered
[2022/04/10 14:46:02.825079, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'ntlmssp' registered
[2022/04/10 14:46:02.825085, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'ntlmssp_resume_ccache' registered
[2022/04/10 14:46:02.825096, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'http_basic' registered
[2022/04/10 14:46:02.825102, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'http_ntlm' registered
[2022/04/10 14:46:02.825107, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'krb5' registered
[2022/04/10 14:46:02.825113, 3] ../auth/gensec/gensec_start.c:977(gensec_register)
GENSEC backend 'fake_gssapi_krb5' registered
[2022/04/10 14:46:02.833027, 3] ../auth/ntlmssp/ntlmssp_util.c:69(debug_ntlmssp_flags)
Got NTLMSSP neg_flags=0xe2088297
[2022/04/10 14:46:02.916945, 3] ../auth/ntlmssp/ntlmssp_server.c:454(ntlmssp_server_preauth)
Got user=[sambauser] domain=[DESKTOP-087T07G] workstation=[DESKTOP-087T07G] len1=24 len2=238
[2022/04/10 14:46:02.917077, 3] ../source3/param/loadparm.c:3866(lp_load_ex)
lp_load_ex: refreshing parameters
[2022/04/10 14:46:02.917214, 3] ../source3/param/loadparm.c:549(init_globals)
Initialising global parameters
[2022/04/10 14:46:02.917487, 3] ../source3/param/loadparm.c:2780(lp_do_section)
Processing section "[global]"
[2022/04/10 14:46:02.917799, 1] ../lib/param/loadparm.c:1823(lpcfg_do_global_parameter)
WARNING: The "syslog" option is deprecated
[2022/04/10 14:46:02.918090, 2] ../source3/param/loadparm.c:2797(lp_do_section)
Processing section "[printers]"
[2022/04/10 14:46:02.918231, 2] ../source3/param/loadparm.c:2797(lp_do_section)
Processing section "[print$]"
[2022/04/10 14:46:02.918328, 2] ../source3/param/loadparm.c:2797(lp_do_section)
Processing section "[WD_12TB]"
[2022/04/10 14:46:02.918427, 2] ../source3/param/loadparm.c:2797(lp_do_section)
Processing section "[Seagate_8TB]"
[2022/04/10 14:46:02.918518, 2] ../source3/param/loadparm.c:2797(lp_do_section)
Processing section "[Seagate_5TB]"
[2022/04/10 14:46:02.918609, 2] ../source3/param/loadparm.c:2797(lp_do_section)
Processing section "[TorrentBox]"
[2022/04/10 14:46:02.918700, 2] ../source3/param/loadparm.c:2797(lp_do_section)
Processing section "[WD_EXT]"
[2022/04/10 14:46:02.918818, 3] ../source3/param/loadparm.c:1615(lp_add_ipc)
adding IPC service
[2022/04/10 14:46:02.918872, 3] ../source3/auth/auth.c:189(auth_check_ntlm_password)
check_ntlm_password: Checking password for unmapped user [DESKTOP-087T07G]\[sambauser]@[DESKTOP-087T07G] with the new password interface
[2022/04/10 14:46:02.918903, 3] ../source3/auth/auth.c:192(auth_check_ntlm_password)
check_ntlm_password: mapped user is: [DESKTOP-087T07G]\[sambauser]@[DESKTOP-087T07G]
[2022/04/10 14:46:02.919396, 3] ../source3/passdb/lookup_sid.c:1759(get_primary_group_sid)
Forcing Primary Group to 'Domain Users' for sambauser
[2022/04/10 14:46:02.920064, 3] ../source3/auth/auth.c:256(auth_check_ntlm_password)
auth_check_ntlm_password: sam_ignoredomain authentication for user [sambauser] succeeded
[2022/04/10 14:46:02.927176, 3] ../auth/auth_log.c:760(log_authentication_event_human_readable)
Auth: [SMB2,(null)] user [DESKTOP-087T07G]\[sambauser] at [Sun, 10 Apr 2022 14:46:02.927134 -03] with [NTLMv2] status [NT_STATUS_OK] workstation [DESKTOP-087T07G] remote host [ipv4:192.168.0.112:64072] became [UBUNTU]\[sambauser] [S-1-5-21-2092467104-2299291568-701835823-1000]. local host [ipv4:192.168.0.136:445]
[2022/04/10 14:46:02.927432, 3] ../auth/auth_log.c:220(log_json)
JSON Authentication: {"timestamp": "2022-04-10T14:46:02.927308-0300", "type": "Authentication", "Authentication": {"version": {"major": 1, "minor": 0}, "status": "NT_STATUS_OK", "localAddress": "ipv4:192.168.0.136:445", "remoteAddress": "ipv4:192.168.0.112:64072", "serviceDescription": "SMB2", "authDescription": null, "clientDomain": "DESKTOP-087T07G", "clientAccount": "sambauser", "workstation": "DESKTOP-087T07G", "becameAccount": "sambauser", "becameDomain": "UBUNTU", "becameSid": "S-1-5-21-2092467104-2299291568-701835823-1000", "mappedAccount": "sambauser", "mappedDomain": "DESKTOP-087T07G", "netlogonComputer": null, "netlogonTrustAccount": null, "netlogonNegotiateFlags": "0x00000000", "netlogonSecureChannelType": 0, "netlogonTrustAccountSid": "(NULL SID)", "passwordType": "NTLMv2"}}
[2022/04/10 14:46:02.927499, 2] ../source3/auth/auth.c:314(auth_check_ntlm_password)
check_ntlm_password: authentication for user [sambauser] -> [sambauser] -> [sambauser] succeeded
[2022/04/10 14:46:02.927558, 3] ../auth/ntlmssp/ntlmssp_sign.c:509(ntlmssp_sign_reset)
NTLMSSP Sign/Seal - Initialising with flags:
[2022/04/10 14:46:02.927586, 3] ../auth/ntlmssp/ntlmssp_util.c:69(debug_ntlmssp_flags)
Got NTLMSSP neg_flags=0xe2088215
[2022/04/10 14:46:02.927663, 3] ../auth/ntlmssp/ntlmssp_sign.c:509(ntlmssp_sign_reset)
NTLMSSP Sign/Seal - Initialising with flags:
[2022/04/10 14:46:02.927690, 3] ../auth/ntlmssp/ntlmssp_util.c:69(debug_ntlmssp_flags)
Got NTLMSSP neg_flags=0xe2088215
[2022/04/10 14:46:02.928215, 3] ../source3/auth/token_util.c:559(finalize_local_nt_token)
Failed to fetch domain sid for WORKGROUP
[2022/04/10 14:46:02.928314, 3] ../source3/auth/token_util.c:591(finalize_local_nt_token)
Failed to fetch domain sid for WORKGROUP
[2022/04/10 14:46:02.938326, 3] ../source3/smbd/password.c:144(register_homes_share)
Adding homes service for user 'sambauser' using home directory: '/home/sambauser'
知道如何修复这个问题吗?
谢谢。
答案1
通过反复试验,发现了以下问题:
在CMD中:
E:\>NET USE Z: \\x.x.x.x\sharename youruserpassword /PERSISTENT:NO /USER:yourusername
Error de sistema 67.
将 Samba 升级到版本 4.19.4,我查看了 man smb.conf 并做了以下更改(因为它是为 SMB2 配置的):
[global]
workgroup = BLUECROSS
client min protocol = SMB3
client max protocol = SMB3
client smb encrypt = required
client signing = required
server min protocol = SMB3
server max protocol = SMB3
ntlm auth = ntlmv2-only
现在它可以工作了:
E:\>NET USE Z: \\x.x.x.x\sharename youruserpassword /PERSISTENT:NO /USER:yourusername
Se ha completado el comando correctamente.
E:\>DIR Z:
El volumen de la unidad Z es sharename
El número de serie del volumen es: 3C72-71F2
Directorio de Z:\
12/01/2024 10:28 p. m. <DIR> .
12/01/2024 10:28 p. m. <DIR> ..
14/12/2023 09:49 p. m. <DIR> Documents
14/12/2023 10:34 p. m. <DIR> Downloads
10/01/2024 12:09 a. m. <DIR> Music
07/03/2022 01:06 p. m. <DIR> Pictures
12/05/2023 07:43 p. m. <DIR> Videos
0 archivos 0 bytes
7 dirs 537,922,781,184 bytes libres
E:\>NET USE Z: /DELETE
Z: se ha eliminado.
Win11 上的其他设置可能会有帮助,我事先进行了以下设置:
配置、网络和互联网、属性:私人(非公开)配置、网络和互联网、高级网络设置、高级共享设置:所有网络:128 位加密
答案2
请参阅本文中的 3.b,https://seamusdemora.github.io/PiFormulae/FileShare.html
简而言之,您需要为 Samba 创建一个密码,例如:$ sudo smbpasswd -a pi 新的 SMB 密码:重新输入新的 SMB 密码: