Mounting a samba share
-
Okay, so I'm a bit stumped. My Linux servers are doing nightly backups which a script then pushes onto a Samba share on a Windows Server.
For that I mounted the share into
/mnt/share
, rsync'ed the backup onto the share and then unmounted the whole thing again when it was finished.The command I used is as follows:
/usr/bin/mount -t cifs //print-srv/remote_share /mnt/share -o user=foo,password=baz,domain=AD
Worked like a charm. Until it didn't. This command now yields
mount error(5): Input/output error
Googling a bit told me that I should try to downgrade the Samba version with
vers=1.0
orvers=2.0
or instead usesec=ntlm
like this/usr/bin/mount -t cifs //print-srv/remote_share /mnt/share -o user=foo,password=baz,domain=AD,sec=ntlm
Well, the last one changes it insofar as that I'm now getting
mount error(2): No such file or directory
which is a shitty error message because the actual root of the error is revealed by
dmesg
:[22718.236388] No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount. [22718.293411] CIFS VFS: Unable to select appropriate authentication method! [22718.293413] CIFS VFS: \\print-srv Send error in SessSetup = -22 [22718.309068] CIFS VFS: cifs_mount failed w/return code = -2
However, using
vers=1.0
only gets me the Input/output error again (the same indmesg
)Anyone here ever run into this?
edit: Oh, and if I use
smbclient
and the same credentials, I can access the share just fine.
-
-
Which version of Windows Server is it?
-
@cheong said in Mounting a samba share:
@Rhywden said in Mounting a samba share:
sec=ntlm
Try use "sec=ntlmssp" instead?
Already did. No dice.
-
-
@Rhywden You've tried explicitly setting it
vers=3.0
?Do you have access to the Windows Server to check if it's got SMB encryption enabled?
edit: or to the Windows Event Log to see if Windows gives any clues
-
@Rhywden said in Mounting a samba share:
/usr/bin/mount -t cifs //print-srv/remote_share /mnt/share -o user=foo,password=baz,domain=AD
Shouldn't it be:
/usr/bin/mount -t cifs //print-srv/remote_share /mnt/share -o user=foo,domain=corpdomain,password=baz,sec=ntlm
@Rhywden said in Mounting a samba share:
Googling a bit told me that I should try to downgrade the Samba version with vers=1.0 or vers=2.0 or instead use sec=ntlm like this
The first suggestion was likely highly outdated. I recently ran into an issue involving an older DroboFS on my home network and I was entirely unable to get any modern version of Debian and Samba to write to it at all as the Drobo only supports SMB 1 at most. I remember it all being very not fun and those Drobos are now unused.
Try the change I suggested of putting domain before password and get back to me on whether or not that works and if there is any change in error message. I believe that the times I have seen the error message you posted it was due to something in Samba changing the formatting for username, password and domain and how it was parsed.
Another thing to check is what happens if you run the command but substitute in the IP address instead of the computer name? Any change?
-
@loopback0 said in Mounting a samba share:
@Rhywden You've tried explicitly setting it
vers=3.0
?Do you have access to the Windows Server to check if it's got SMB encryption enabled?
edit: or to the Windows Event Log to see if Windows gives any clues
vers=3.0
did nothing. Don't know where to look for SMB encryption. And the event log does not register anything - and I looked at all available logs.
-
@Polygeekery said in Mounting a samba share:
@Rhywden said in Mounting a samba share:
/usr/bin/mount -t cifs //print-srv/remote_share /mnt/share -o user=foo,password=baz,domain=AD
Shouldn't it be:
/usr/bin/mount -t cifs //print-srv/remote_share /mnt/share -o user=foo,domain=corpdomain,password=baz,sec=ntlm
@Rhywden said in Mounting a samba share:
Googling a bit told me that I should try to downgrade the Samba version with vers=1.0 or vers=2.0 or instead use sec=ntlm like this
The first suggestion was likely highly outdated. I recently ran into an issue involving an older DroboFS on my home network and I was entirely unable to get any modern version of Debian and Samba to write to it at all as the Drobo only supports SMB 1 at most. I remember it all being very not fun and those Drobos are now unused.
Try the change I suggested of putting domain before password and get back to me on whether or not that works and if there is any change in error message. I believe that the times I have seen the error message you posted it was due to something in Samba changing the formatting for username, password and domain and how it was parsed.
Another thing to check is what happens if you run the command but substitute in the IP address instead of the computer name? Any change?
Changing the order did not do anything, substituting the IP address also changed nothing.
Both yield
mount error(2): No such file or directory
I'm still not sure how smbclient works but mount doesn't. Very strange.
-
Just found the culprit. Since the Windows Server is not something I administer, I also trust our contractor to not do foolish things.
Well, obviously they changed something because I just tried to access the share through the Explorer's Network tab on the server itself. The share does show up - but is not accessible because the "device is not ready".
And the smbclient not yielding any errors obviously comes from the fact that, while it does connect to the server, it obviously does not do anything so it does not realize that the share is inaccessible.
So, thanks guys for your help. But next time I'll first have a look at the obvious: Is the other side still there?
-
@Rhywden said in Mounting a samba share:
I also trust our contractor to not do foolish things.
-
@Rhywden said in Mounting a samba share:
Don't know where to look for SMB encryption
Some Powershell incantation, natch.
@Rhywden said in Mounting a samba share:
I also trust our contractor to not do foolish things.
D'oh.
-
@loopback0 said in Mounting a samba share:
@Rhywden said in Mounting a samba share:
Don't know where to look for SMB encryption
Some Powershell incantation, natch.
Iä, Iä, Fhtagn?
-
@Rhywden said in Mounting a samba share:
@loopback0 said in Mounting a samba share:
@Rhywden said in Mounting a samba share:
Don't know where to look for SMB encryption
Some Powershell incantation, natch.
Iä, Iä, Fhtagn?
Might as well be
-
@Rhywden said in Mounting a samba share:
I also trust our contractor to not do foolish things.
You sweet, sweet, summer child. Contractors are idiots.
(I can say that because I am a contractor. All other contractors are idiots. Yes, I realize that they probably say the same thing about us.)
-
@Rhywden said in Mounting a samba share:
But next time I'll first have a look at the obvious: Is the other side still there?
Is the server plugged in?
LOL
-
@Polygeekery said in Mounting a samba share:
@Rhywden said in Mounting a samba share:
I also trust our contractor to not do foolish things.
You sweet, sweet, summer child. Contractors are idiots.
(I can say that because I am a contractor. All other contractors are idiots. Yes, I realize that they probably say the same thing about us.)
No, you guys are assholes.
-
@Rhywden said in Mounting a samba share:
Googling a bit told me that I should try to downgrade the Samba version with
vers=1.0
orvers=2.0
or instead usesec=ntlm
like thisYeah that's usually the exact opposite that should be done, as Windows Servers are now disabling lower versions by default.
I assume the cifs library must needs be updated.
Let's read the thread now!
-
@Rhywden said in Mounting a samba share:
So, thanks guys for your help. But next time I'll first have a look at the obvious: Is the other side still there?
.... wow.
-
@Rhywden said in Mounting a samba share:
@loopback0 said in Mounting a samba share:
@Rhywden said in Mounting a samba share:
Don't know where to look for SMB encryption
Some Powershell incantation, natch.
Iä, Iä, Fhtagn?
wgahnagl Ftahgn.