Find the answer to your Linux question:
Results 1 to 4 of 4
Hi I am trying to send files to a Windows server from Linux on command for I'll need to create a script that will be scheduled in cron to do ...
  1. #1
    Just Joined!
    Join Date
    Sep 2006
    Posts
    21

    Sending files to Windows from Linux

    Hi

    I am trying to send files to a Windows server from Linux on command for I'll need to create a script that will be scheduled in cron to do this.
    Please help.

  2. #2
    Trusted Penguin Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,392
    You have a number of ways to do this, check some of them out:

    - Email is probably the easiest, if you email the file to the windows user, then the file will be on the windows pc without needing any special tools.

    - Samba can be used to mount windows shares, look into adding a line to your /etc/fstab file to declare the remote filesyste, mount it with the 'mount' command, then copy the file over with 'cp'.

    - You can use secure shell - there are ssh servers for windows, if you set up access using public/private key pairs, then you can just use 'scp' to copy any file to the remote windows machine.

    - You could set up an ftp server on the windows machine, then ftp the file over.

    - You could even write the file to a floppy disk and physically move the disk to the other machine.
    Linux user #126863 - see http://linuxcounter.net/

  3. #3
    Just Joined!
    Join Date
    Sep 2006
    Posts
    21
    Thanks for responding.
    I am trying the SSH Server option. I have just installed the SSH server on Windows and have tried to make changes to the passwd file as advised. Please see below. If this is right, then what do I need to do next?

    Passwd file:
    Administrator:unused_by_nt/2000/xp:500:513:U-NB-BAFANAM\Administrator,S-1-5-21-1004336348-1606980848-839522115-500: */cygdrive/c/Documents and Settings/nomthie.dumisa/Administrator:/bin/switch

  4. #4
    Linux User Oxygen's Avatar
    Join Date
    Jul 2004
    Location
    Hartlepool, England
    Posts
    392
    I'd say that samba would be the easiest way to do it.

    You'll need smbfs, which you can get and read about here: Linux Enhanced SMBFS

    Download that tarball and make then make install it.

    Make the folder you want to mount it on:
    mkdir /mnt/server

    Also you'll need to place credentials for connecting to the server in a file. Use nano and type the following:
    Code:
    username=<windows username>
    password=<windows password>
    Save that as something like /etc/.wincred and chmod it so only you can read it:

    chmod 600 /etc/.wincred

    Add this line to /etc/fstab
    //server/share /mnt/server smbfs credentials=/etc/.wincred,defaults,nls=utf8,umask=007,gid=46,dmask= 777,fmask=777,rw 0 0

    And you'll be sorted! Move files with the 'mv' command like 'mv /home/user/file /mnt/server/sharelocation

    Any questions?
    Graham - You'd better Use Linux!

    I'm registerd Linux user #397030. What about you?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...