Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 3 down vote accepted

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.

share|improve this answer

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.

share|improve this answer
    
Thanks for this idea. Is there a way to use the SSH keys on windows without the passphrase? –  user29254 Dec 16 '09 at 6:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.