Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you help me access Mac SMB share from Ubuntu using smbclient? (NT_STATUS_ACCESS_DENIED error) [closed]

I've been working on a file server product that uses smbcilent to transfer files between client computers and the server. It's been working great so far with our LAMP (Ubuntu) server and Windows machines.

I'm currently trying to expand the setup to include Mac's, but am having trouble with the server accessing the share on the Mac.

Here's my command and error (bracketed descriptions replace private info):

# smbclient //10.101.0.7/[share-file] -U [username]%[password] -c ls
WARNING: The "syslog" option is deprecated
NTLMSSP packet check failed due to short signature (0 bytes)!
NTLMSSP NTLM2 packet check failed due to invalid signature!
session setup failed: NT_STATUS_ACCESS_DENIED

Things I've tried:

✓ Accessing share using a Windows machine to ensure the share is setup properly - check! Works fine there.

✓ Invoking -S off or --signing=off in the command - no change.

✓ Just looking at the shares first using smbclient -L 10.101.0.7 -U [username]%[password] - same error.

✓ Googling for an answer - check! Several people with similar problems, but no working solutions so far.

The most promising thing I've see so far involves compiling smbclient 4.4 from sources and running that with no authentication (-U ""%""), but that seems like a temporary solution based on a bug rather than a solid plan that will work for a long time. (But I'll try that next if I can't find any better ideas...)

Thanks for reading and trying to help!

like image 426
J.D. Sandifer Avatar asked Oct 16 '25 11:10

J.D. Sandifer


1 Answers

Try adding --option="ntlmssp_client:force_old_spnego = yes" to the smbclient command as suggested on the samba-technical mailing list.

For me, this now lists shares on a Mac OSX server:

smbclient -U$user%$password -L $mac_host --option="ntlmssp_client:force_old_spnego = yes"

For mounting, you may need to add the nounix,sec=ntlmssp options as in

sudo mount -t cifs //$mac_host/$share $mountpoint -o nounix,sec=ntlmssp,username=$user,password=$password
like image 173
mivk Avatar answered Oct 19 '25 01:10

mivk