2

I am looking for a way to do a bulk upload of a list of media files from a remote windows machine to a Linux server.

The files should be encrypted before sending so I am looking at either SCP or SFTP.

The files are uploaded to a public web directory so they can be viewed on a website hosted on the Linux server.

The problem with my existing solution is that the username and password for the server is stored on the remote machine. Using these credentials, one could access the whole web server so it is obviously that I need to replace them.

The other problem is that I want to only give the remote pc the ability to write to the public directory and nothing else, while still allowing the web server to access these files.

How can I set this up?

Thank you

2 Answers2

4

1) Use SSH Public Key Authentication instead of plain-text passwords

2) Your SFTP server should allow you to limit the directories that the logged in user can access. Generally by default this is the user's HOME directory. One neat trick I found is the use of the mount --bind /new/bind/path feature. This will allow you to bind the public directory to another location (such as the ftp user's HOME directory) and any writes to either location will be reflected in both.

If you want to do SSH with Public Key Authentication on Windows, download the free PuTTY SSH client (putty.exe) and the look at this link for a Howto on public key with PuTTY.

SiegeX
  • 567
  • 1
  • 6
  • 16
0

I'll second SiegeX's suggestion of using SSH keys to login.

I've done something similar in the past using putty's PSCP program. It's easy enough to use it in a script to automate things if you use SSH keys instead of passwords. I wrote a quick perl script using activeperl and then just double clicked it in windows and whenever I wanted to upload changes.

Brandon
  • 276
  • 1
  • 2
  • Thanks for this idea. Is there a way to use the SSH keys on windows without the passphrase? –  Dec 16 '09 at 06:33