Posts

Showing posts from October, 2017

Install Win32 OpenSSH and Enable Public Key Authentication

Setup of a SFTP server is much more complicated than FTPS. To have a full featured SFTP server, OpenSSH seems to be  the only option. The original OpenSSH is for Unix only.  Fortunately Win32 OpenSSH was  recently released by Microsoft though for testing only. Here I use SFTPServer  as SSH Server while SFTPClient as SSH client. 1. Server side Installation C:\Program Files (x86)\OpenSSH>net start sshd https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH This tutorials works. Note 1. Generation and Use of Host Keys Host keys are generated by .\ssh-keygen.exe -A. Host key are stord in  C:\Program Files (x86)\OpenSSH on server. http://man7.org/linux/man-pages/man1/ssh-keygen.1.html -A For each of the key types (rsa1, rsa, dsa, ecdsa and ed25519) for which host keys do not exist, generate the host keys with the default key file path, an empty passphrase, default bits for the key type, and default comment.

Confusing Concepts about SFTP: SSH2 vs OpenSSH

Credit and copied from https://dada.tw/2008/01/03/70/ Terminology: SSH Protocols and Products SSH A generic term referring to SSH protocols or software products. SSH-1 The SSH protocol, Version 1. This protocol went through several revisions, of which 1.3 and 1.5 are the best known, and we will write SSH-1.3 and SSH-1.5 should the distinction be necessary. SSH-2 The SSH protocol, Version 2, as defined by several draft standards documents of the IETF SECSH working group. SSH1 Tatu Ylönen's software implementing the SSH-1 protocol; the original SSH. Now distributed and maintained (minimally) by SSH Communications Security, Inc. SSH2 The "SSH Secure Shell" product from SSH Communications Security, Inc. This is a commercial SSH-2 protocol implementation, though it is licensed free of charge in some circumstances. ssh (all lowercase letters) A client program included in SSH1, SSH2, OpenSSH, F-Secure SSH, and other

My Simple Upload Program using FTPs (Net Core 2.0 and Visual Studio 2017 v15.3.5)

1. FTPS Server is built in IIS7 2. FtpWebRequest seems to work well in Net Core v2 using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using FTPs.Models; using System.Net; using System.IO; using System.Text; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using System.Text.RegularExpressions; namespace FTPs.Controllers {     public class HomeController : Controller     {         public X509Certificate2 FindCertificateFromStore(X509FindType findType, string findValue)         {               //W10: type certificate to search and select Manager User Certificates               X509Store store = new X509Store(StoreName.Root, StoreLocation.CurrentUser);             store.Open(OpenFlags.ReadOnly);             // https://stackoverflow.com/questions/8448147/problems-with-x509store-certificates-find-findbythumbprint