Stack Exchange Network
Stack Exchange network consists of 181 Q&A communities including
Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
The best answers are voted up and rise to the top
13 years, 10 months ago
I am writing a
bash script to analyze the mail logs on our network, which is mostly postfix boxes, but would like to include MS Exchange logs in the analysis if possible.
Is there any way to copy a file off of a windows machine remotely from the command line in linux? (note: I have admin priv's on the windows box)
May 6, 2009 at 13:59
22.6k 19 19 gold badges 68 68 silver badges 102 102 bronze badges
Make the Windows folder a share and mount it on Linux?
mount.cifs //windows/share /mnt/windows -o "user=Administrator"
May 6, 2009 at 14:06
Adam Gibbins Adam Gibbins
7,227 2 2 gold badges 28 28 silver badges 42 42 bronze badges
to backup my Windows box to my Linux server. It installs as a service under Windows.
You could also use
smbclient which is possibly easier to use than actually mounting the remote drive within the Linux server's filesystem.
May 6, 2009 at 14:41
21.1k 3 3 gold badges 49 49 silver badges 81 81 bronze badges
Share the directory on windows and use smbmount to mount it on Linux (then you can use simple cp)
Install an ssh server on the windows machine (possibly using cygwin) and then you can scp the file across
Setup FTP server on windows machine and FTP it across (using wget/ncftpget or similar)
May 6, 2009 at 14:04
1,187 6 6 silver badges 9 9 bronze badges
Use the samba client to mount the administrative share. Rather then having to share a specific folder from with in windows just mount
May 6, 2009 at 17:57
1,420 2 2 gold badges 16 16 silver badges 23 23 bronze badges
If you can't mount a share via CIFS for whatever reason, Core FTP has a very useful free SSH/SFTP server:
May 6, 2009 at 17:40
896 8 8 silver badges 6 6 bronze badges
mounting a share is the best solution, don't forget something like the 'dos2unix' commad to covert newline characters.
May 6, 2009 at 18:12
213 3 3 silver badges 6 6 bronze badges
If the Windows system has an SSH server, that'd work. If not, you could do an SMB/CIFS mount of the drive on the Windows system, then copy the file to your local Linux drive.
May 6, 2009 at 14:05
A few options.
You could mount a Windows share using SMB and then perform the copy/move/etc as needed. You could place the file on a web space and use
wget to fetch it. You could install an
SSH server on the Windows machine, and do a
scp. You could use
NFS to access the Windows drive. You could also send Exchange logs to a syslog server (or use Splunk).
May 6, 2009 at 14:15
You could also try using the WS-Management standard - there's a project called
Openwsman for that in particular but I have no idea of it's current state or compatibility of the client tools with the Windows Vista/Server 2008 implementation. Also see winrm/winrs.
May 6, 2009 at 19:46
Oskar Duveborn Oskar Duveborn
10.7k 3 3 gold badges 32 32 silver badges 48 48 bronze badges
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our
Accept all cookies
Necessary cookies only