Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-02-2012, 04:45 PM   #1
LQ Newbie
Registered: Nov 2012
Posts: 1

Rep: Reputation: Disabled
Want to copy files from Windows share to Linux

Ok, maybe I'm not so new, but it seems like there should be a really simple way to accomplish what I'm after. Before you start typing a quick answer, do NOT tell me to use the mount command to mount the samba share, that's only available if you're root and the /mnt directory is writable, and I'd rather not go there if there's a easier way to do this. I also don't have access to the Windows server machine, except to copy files to/from the shared directory.

So I can do this:
net rpc share -S <windowsserver> -U<myuser>
from my linux box and I can see the directory I want to copy the files from.
My question is, how do I actually copy the files? I've tried the migrate and add command options, but I can't get them to actually do anything and I never see the files on my local linux machine. I've also tried smbclient, and can list the same directories with
smbclient -L <windowsserver> -U<user>
but it doesn't want to go into an interactive mode, and when I try to use -c mget, I can't seem to get the syntax right because it keeps telling me "Not enough '\' characters in service". This seems like it should be so easy, but I'm just not getting it to work and I can't find any examples where the user isn't the system admin with root and admin authority on both the Linux and Windows box.

Thanks for any help or insight.
Old 11-02-2012, 08:31 PM   #2
Registered: Jan 2006
Location: Midwest USA
Distribution: Started with Slackware - 3.0 1995 Kernel 1.2.13 - Now Slackware Current. Also some FreeBSD.
Posts: 124

Rep: Reputation: 59
Not sure if this will work for you or not but try this:

$mount -t cifs //win-share-hostname/share /home/fred/win -o username=user,password=passwd,domain=mydomain

(Of course the above is one line not two, there is a space after the -o)

username, password and domain are your Windows box credentials of course.

In the domain field, you can also type a workgoup name if your Winodws box is not on a domain: domain=name_of_your_workgroup

This has nothing to do with Samba and I think this will work with your current permissions on both the Linux box and the Windows box.

You can create a win directory in your home folder like I did in mine: /home/fred/win

Also, you might want to check out Midnight Commander. It is very sweet for copying files.

In Debian: apt-get install mc

Last edited by Fred-1.2.13; 11-02-2012 at 08:44 PM.
Old 11-02-2012, 08:42 PM   #3
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4866Reputation: 4866Reputation: 4866Reputation: 4866Reputation: 4866Reputation: 4866Reputation: 4866Reputation: 4866Reputation: 4866Reputation: 4866Reputation: 4866
At first, you can mount to any directory, you are not limited to the /mnt directory.
But what I am more interested in, why can't you just elevate your rights to root to use mount? May it be that this is not your machine?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy files from Linux onto Windows grob115 Linux - Server 3 11-29-2010 02:08 PM
Copy directory from Linux box to Windows Share joshnya Linux - Newbie 2 11-10-2006 01:58 PM
copy files form windows app to samba share procfs General 1 07-19-2006 07:13 AM
copy files from linux to windows turbo_acura Linux - General 4 11-23-2004 02:46 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:04 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration