Posts

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 ke...

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);             sto...
Upgrading NetCore from v1.1.0 to v2.0.0 in Visual Studio 2017 Note: Any time if you see "Package restore failed. Rolling back package changes", please seelct Tools/Options:  NuGet Package Manager/General/Clear All NuGet Cache(s) Select Project / Manage Nuget Packages Step 1 Update.csproj Change     <TargetFramework>netcoreapp1.1</TargetFramework> To:     <TargetFramework>netcoreapp2.0</TargetFramework> Note: if this is not changed, you'll receive error "Package restore failed. Rolling back package changes" Step 2 Update all installed packages In NuGet Package Manager, select Updates tab, select All package and click Update Step 3 Install-Package Microsoft.EntityFrameworkCore.SqlServer See https://docs.microsoft.com/en-us/ef/core/ After done, all packages references in .csproj will be automatically updated to v2.0 For all other errors, please refer to the following must reading sites: https://docs...

Two easy ways to resolve the failure in SelectedValue in MVC DropDownList

Two easy ways to resolve the failure in SelectedValue in MVC DropDownList Scaffolding my Net Core project using Visual Studio 2017 : Model public class Site   {          public int Id { get; set; }          public string Name { get; set; }          public virtual ICollection<Lease> Leases { get; set; }   } public class Lease     {         public int Id { get; set; }         public string Name { get; set; }         public int SiteId { get; set; }         public virtual Site Site { get; set; }     } Create.cshtml  <select asp-for="SiteId" class="form-control" asp-items="ViewBag.SiteId">      <option>Please select site</option>  </select> LeasesController.cs         // GET: Leases/Create     ...

Journal - Start to Learn ASP.NET Core MVC

7 July 2017 Visual Studio 2017 ISSUE 1. Erring when adding a controller: "xxx\bin\Debug\netcoreapp1.1\ProjectName.deps.json doesn't exist" SOLUTION Right click project and Publish, change Settings/Configuration to: Debug. All required .json files will be immediately generated in the mentioned folder (you don't need to really publish the project). ISSUE 1. Erring when adding a view: "Error: assembly specified in the dependencies manifest was not found." SOLUTION Right click project and Publish, publish it.

Enable-SPFeature : A list, survey, discussion board, or document library with the specified title already exists in this Web site.

Image
SharePoint 2010: Today to update a list definition, I manually deleted a list, then disable and then enable the feature trying to recreate the list, but I got weird error: "Field name already exists. The name used for this field is already used by another field in the list. Select another name and try again." Investigation showed this error info did not make sense. Suddenly the error info changed to: "Enable-SPFeature : A list, survey, discussion board, or document library with the specified title already exists in this Web site...." In one word, I was no longer able to create the list using this feature. SharePoint Manager showed: the Alert list was really deleted but its ROOTFOLDER was still left there - weird! I deleted this folder, all errors are gone! Thanks to this link which enlightened me a bit: http://blog.repsaj.nl/index.php/2010/04/sp2010-error-activating-sharepoint-server-publishing-infrastructure/