<p>We need to move off traditional FTP for security purposes (it transmits it's passwords unencrypted). I am hearing SSH touted as the obvious alternative. However I have been driving FTP from an ASP.NET program interface to automate my web-site development, which is now quite a highly web-enabled process. </p>

<p>Can anyone recommend a secure way to transfer files around which has a program interface that I can drive from ASP.NET?</p>

[{'answer_id': 39074, 'author': 'Galwegian', 'author_id': 3201, 'author_profile': 'https://Stackoverflow.com/users/3201', 'pm_score': 1, 'selected': False, 'text': '<p>We have used a variation of <a href="http://www.jscape.com/articles/sftp_using_csharp.html" rel="nofollow noreferrer">this solution</a> in the past which uses the SSH Factory for .NET </p>\n'}, {'answer_id': 39075, 'author': 'Peter Hoffmann', 'author_id': 720, 'author_profile': 'https://Stackoverflow.com/users/720', 'pm_score': 2, 'selected': False, 'text': '<p><a href="http://www.codeproject.com/KB/IP/sharpssh.aspx" rel="nofollow noreferrer">sharpssh</a> implements sending files via scp.</p>\n'}, {'answer_id': 39094, 'author': 'Rob Wells', 'author_id': 2974, 'author_profile': 'https://Stackoverflow.com/users/2974', 'pm_score': 0, 'selected': False, 'text': '<p>G\'day,</p>\n<p>You might like to look at <a href="http://www.proftpd.org/" rel="nofollow noreferrer">ProFPD</a>.</p>\n<p>Heavily customisable. Based on Apache module structure.</p>\n<p>From their web site:</p>\n<blockquote>\n<p>ProFTPD grew out of the desire to have a secure and configurable FTP server, and out of a significant admiration of the Apache web server.</p>\n</blockquote>\n<p>We use our adapted version for large scale transfer of web content. Typically 300,000 updates per day.</p>\n<p>HTH</p>\n<p>cheers,</p>\n<p>Rob</p>\n'}, {'answer_id': 39175, 'author': 'Hank Gay', 'author_id': 4203, 'author_profile': 'https://Stackoverflow.com/users/4203', 'pm_score': 1, 'selected': False, 'text': '<p>The traditional secure replacement for FTP is <a href="http://en.wikipedia.org/wiki/SSH_file_transfer_protocol" rel="nofollow noreferrer">SFTP</a>, but if you have enough control over both endpoints, you might consider <a href="http://en.wikipedia.org/wiki/SSH_file_transfer_protocol" rel="nofollow noreferrer">rsync</a> instead: it is highly configurable, secure just by telling it to use ssh, and far more efficient for keeping two locations in sync.</p>\n'}, {'answer_id': 84138, 'author': 'Martin Vobr', 'author_id': 16132, 'author_profile': 'https://Stackoverflow.com/users/16132', 'pm_score': 3, 'selected': True, 'text': '<p>the question has three subquestions:</p>\n\n<p>1) choosing the secure transfer protocol</p>\n\n<p>The secure version of old FTP exists - it\'s called FTP/SSL (plain old FTP over SSL encrypted channel). Maybe you can still use your old deployment infrastructure - just check whether it supports the FTPS or FTP/SSL.</p>\n\n<p>You can check details about FTP, FTP/SSL and SFTP differences at <a href="http://www.rebex.net/secure-ftp.net/" rel="nofollow noreferrer">http://www.rebex.net/secure-ftp.net/</a> page.</p>\n\n<p>2) SFTP or FTP/SSL server for Windows</p>\n\n<p>When you choose whether to use SFTP or FTPS you have to deploy the proper server. For FTP/SSL we use the Gene6 (<a href="http://www.g6ftpserver.com/" rel="nofollow noreferrer">http://www.g6ftpserver.com/</a>) on several servers without problems. There is plenty of FTP/SSL Windows servers so use whatever you want. The situation is a bit more complicated with SFTP server for Windows - there is only a few working implementations. The Bitvise WinHTTPD looks quite promising (<a href="http://www.bitvise.com/winsshd" rel="nofollow noreferrer">http://www.bitvise.com/winsshd</a>).</p>\n\n<p>3) Internet File Transfer Component for ASP.NET</p>\n\n<p>Last part of the solution is secure file transfer from asp.net. There is several components on the market. I would recommend the <a href="http://www.rebex.net/file-transfer-pack/" rel="nofollow noreferrer">Rebex File Transfer Pack</a> - it supports both FTP (and FTP/SSL) and SFTP (SSH File Transfer).</p>\n\n<p>Following code shows how to upload a file to the server via SFTP. The code is taken from our <a href="http://www.rebex.net/sftp.net/tutorial-sftp.aspx#upload-download" rel="nofollow noreferrer">Rebex SFTP tutorial page</a>.</p>\n\n<pre><code>// create client, connect and log in \nSftp client = new Sftp();\nclient.Connect(hostname);\nclient.Login(username, password);\n\n// upload the \'test.zip\' file to the current directory at the server \nclient.PutFile(@"c:\\data\\test.zip", "test.zip");\n\n// upload the \'index.html\' file to the specified directory at the server \nclient.PutFile(@"c:\\data\\index.html", "/wwwroot/index.html");\n\n// download the \'test.zip\' file from the current directory at the server \nclient.GetFile("test.zip", @"c:\\data\\test.zip");\n\n// download the \'index.html\' file from the specified directory at the server \nclient.GetFile("/wwwroot/index.html", @"c:\\data\\index.html");\n\n// upload a text using a MemoryStream \nstring message = "Hello from Rebex SFTP for .NET!";\nbyte[] data = System.Text.Encoding.Default.GetBytes(message);\nSystem.IO.MemoryStream ms = new System.IO.MemoryStream(data);\nclient.PutFile(ms, "message.txt");\n</code></pre>\n\n<p>Martin</p>\n'}]
['https://Stackoverflow.com/questions/39070', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4180/']