3

I have a requirement which says it should be able to upload and download a file from a Windows shared drive using UNIX. How to approach that ? Should it be done using ftp or sftp ? Please explain.

1
  • 1
    You just need to mount windows shared drive in unix using samba, then just simply copy files using cp as local. take look at this link => wiki.samba.org/index.php/… Nov 12, 2014 at 5:01

2 Answers 2

2

There is two requirements here:

  • take a file from a drive shared from a windows machine
  • upload a file (somewhere) using ftp/sftp

The first can be accomplised by using the Samba client for Unix, which allows you to mount a remote windows share on a Unix directory. Once that is done you can read the files (maybe also write, but that is not necessary).

For the second part you should go with sftp, as the "s" in there stands for secure. With the old ftp passwords can be sniffed. sftp is normally part of the ssh package. If possible you might want to look at using scp, the server that you are uploading to should support that as well. You should consider setting up passwordless login to the server using a public key (ssh-keygen and ssh-copy-id)

There is no need to setup a FTP server (or an SSH server) on the Unix machine that needs to do the uploading, isstalling Samba client and ssh (client) is enough.

1

FTP uses PORT 21 SFTP uses PORT - whichever your SSH Daemon is listening to.

To get data/send use "STOR". This could be used for shared drives as well as with server.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .