Need A Script To Copy From Windows Share

Using applications, configuring, problems
Post Reply
Message
Author
p310don
Posts: 1492
Joined: Tue 19 May 2009, 23:11
Location: Brisbane, Australia

Need A Script To Copy From Windows Share

#1 Post by p310don »

So I have been using puppy to make an automated backup from a windows share for a couple of years and it works fine. So I decided to change things...

I am trying to use Xenial to mount a samba share. The mount section of the script I have previously been using in Carolina without issue is:

Code: Select all

mount.cifs //192.168.1.50/c-drive /mnt/server -o password=123
but now it hangs and refuses to mount. I am not sure what the issue is. There is no actual password on the windows share, and I cannot change that.

If I use the command

Code: Select all

smbclient //server/c-drive -U root%woofwoof
it happily looks into the windows share, but I can't / don't know how to copy from it.

Any help?

Thanks

User avatar
Galbi
Posts: 1098
Joined: Wed 21 Sep 2011, 22:32
Location: Bs.As. - Argentina.

#2 Post by Galbi »

It happened to me and had to change mount.cifs for mount -t cifs

In my script I have something like this:

Code: Select all

mount -t cifs -o username=anonymous,password=anonymous //192.168.1.23/C /root/server/C/
Hope that helps.
Remember: [b][i]"pecunia pecuniam parere non potest"[/i][/b]

p310don
Posts: 1492
Joined: Tue 19 May 2009, 23:11
Location: Brisbane, Australia

#3 Post by p310don »

Hope that helps.
I was hoping too. Unfortunately that does nothing to change things for me. It works with the older Puppy, but the exact same thing doesn't work here. Very frustrating! :x

p310don
Posts: 1492
Joined: Tue 19 May 2009, 23:11
Location: Brisbane, Australia

#4 Post by p310don »

Ok. Got it to work.

This is a problem with 4.13+ kernels. I found out about the problem mentioned in the YASSM thread and the solution was almost there, but further googling confirmed.

The version needs to be added to the mount line to make it work. So now I have:

Code: Select all

mount.cifs -o username=root,password=123,vers=1.0 //192.168.1.50/c-drive /mnt/server
note the vers=1.0 after username & password and it works!

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#5 Post by rcrsn51 »

p310don wrote:note the vers=1.0
So it looks like you must now explicitly state the SMB version of the target server, regardless of its age.

p310don
Posts: 1492
Joined: Tue 19 May 2009, 23:11
Location: Brisbane, Australia

#6 Post by p310don »

It seems that the default in Kernel 4.13 is to use SMB version 3 for security with modern windows.

My windows machines in this instance are XP based, which is version 1, so that is why it wasn't working.

After reading some info in the XFXenial thread, and the YASSM thread I googled to find this page:

https://www.linux.com/blog/2017/9/linux ... t-use-smb1

and this info:

https://blogs.technet.microsoft.com/jos ... le-server/

So yes, it seems like you have to state the version of smb protocol to use, definitely for older windows. Someone might have to see if they can get their hands on a modern windows pc (8 or 10) to see if you can omit the vers part of the code and have it still work.

Post Reply