Samba 身份验证失败

Samba 身份验证失败

我一直在寻找到底出了什么问题,但就是搞不清楚。关于在 Ubuntu 上使用 samba,我还有很多不明白的地方,所以如果有什么地方看起来不太对劲,我很抱歉。

在我更新我的 ubuntu 服务器之前,共享正常,教师帐户能够进行身份验证,但是当我更新时,它停止工作。

我正在使用 Ubuntu 服务器:分销商 ID:Ubuntu 描述:Ubuntu 15.10 发行版:15.10 代号:wily

和 samba:版本 4.1.17-Ubuntu

当我尝试从 Windows 计算机映射网络驱动器时(本例中为 Windows 10,也使用 Windows 7 获得类似结果),我收到以下日志结果/var/logs/samba/log.(Windows 的 ip 地址)

check_ntlm_password:  Authentication for user [teacher] -> [teacher] FAILED with error NT_STATUS_NO_SUCH_USER
[2016/01/06 14:00:51.944975,  3] ../source3/auth/auth_util.c:1593(do_map_to_guest_server_info)
  No such user teacher [HeritageFileServer] - using guest account

从 Windows 机器上,我以 HeritageFileServer\teacher 身份登录,我还尝试过 HERITAGEFILESERVER\teacher,以及 teacher,过去,第一个运行良好。

如果我输入 sudo编辑 -L -v据我了解,它应该列出我的 samba 用户,我得到了以下信息:

---------------
Unix username:        tech
NT username:          
Account Flags:        [U          ]
User SID:             S-1-5-21-3838925055-3536237277-778935331-1000
Forcing Primary Group to 'Domain Users' for tech
Primary Group SID:    S-1-5-21-3838925055-3536237277-778935331-513
Full Name:            Tech
Home Directory:       \\heritagefileserver\tech
HomeDir Drive:        
Logon Script:         
Profile Path:         \\heritagefileserver\tech\profile
Domain:               HERITAGEFILESERVER
Account desc:         
Workstations:         
Munged dial:          
Logon time:           0
Logoff time:          never
Kickoff time:         never
Password last set:    Wed, 06 Jan 2016 13:07:05 MST
Password can change:  Wed, 06 Jan 2016 13:07:05 MST
Password must change: never
Last bad password   : 0
Bad password count  : 0
Logon hours         : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
---------------
Unix username:        teacher
NT username:          
Account Flags:        [U          ]
User SID:             S-1-5-21-3838925055-3536237277-778935331-1001
Forcing Primary Group to 'Domain Users' for teacher
Primary Group SID:    S-1-5-21-3838925055-3536237277-778935331-513
Full Name:            
Home Directory:       \\heritagefileserver\teacher
HomeDir Drive:        
Logon Script:         
Profile Path:         \\heritagefileserver\teacher\profile
Domain:               HERITAGEFILESERVER
Account desc:         
Workstations:         
Munged dial:          
Logon time:           0
Logoff time:          never
Kickoff time:         never
Password last set:    Mon, 04 Jan 2016 15:22:14 MST
Password can change:  Mon, 04 Jan 2016 15:22:14 MST
Password must change: never
Last bad password   : 0
Bad password count  : 0
Logon hours         : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

显然teacher是存在的,而且密码很简单,所以我确定我没有弄错,我甚至使用smbpasswd重置了密码以确保无误。

我最终将重要文件夹设置为允许访客帐户,以便教师可以访问驱动器,同时我试图让日志显示它已成功通过身份验证。这是我的 smb.conf 文件(我将 share 和 Share 作为现在向访客开放的原始文件夹,而 Shared 是我的测试文件夹,我正在尝试使其与身份验证配合使用):

#======================= Global Settings =======================

[global]

;workgroup = WORKGROUP

server string = %h server (Samba, Ubuntu)

dns proxy = no

#interfaces = eth0

log level = 3

log file = /var/log/samba/log.%m

max log size = 1000

syslog = 0


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

;server role = standalone server

security = user

guest account = nobody

map to guest = bad user

;usershare allow guests = yes

#======================= Share Definitions =======================

 [printers]
comment = All Printers
browseable = yes
path = /var/spool/samba
printable = yes
guest ok = yes
read only = yes
create mask = 0700

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = yes

[share]
comment= Heritage File Server
path = /media/external/ServerBackup
browsable = yes
guest ok = yes
read only = no
create mask = 0755

[Share]
comment= Heritage File Server
path = /media/external/ServerBackup
browsable = yes
guest ok = yes
read only = no
create mask = 0755

[Shared]
comment= Heritage File Server
path = /media/external/ServerBackup
available = yes
valid users = teacher
browsable = yes
guest ok = no
read only = no
writable = yes
create mask = 0755

[web]
comment = Heritage Web Hosting
path = /var/www/html
browsable = yes
guest ok = no
read only = no
create mask = 0755

[homes]
comment = Home Directories
browsable = yes
read only = yes

有人知道什么问题吗?

答案1

打开终端并尝试以下操作:

sudo smbpasswd -a < username>

这里,< username> 是您的用户名。现在,您将被提示设置并重新输入新密码。

然后,重新启动 smb 服务:

sudo service smbd restart

现在,尝试以通常的方式打开共享位置。输入用户名和刚刚设置的新密码。

您现在就可以登录了。

相关内容