SSH principle

reference
SSH principle

Windows official configuration link

Windows official configuration link

The configuration process

1. Start the SSH service on the server by following the official configuration link

Notice that there are two steps wrong in the official configuration link

  1. OpenssUtils can’t be downloaded officially
  2. Because the tool in 1 cannot be downloaded, the repair-authorizedKeyPermission command cannot be used

2. Try a password connection

complete
The service sideAfter configuring and starting the SSHD service with the following code, you can use the client to try to link, note that the default port is 22

# C:\ Windows \ System32 Administrator: PowerShell > Start-Service SSHD # C:\ Windows \ System32 Administrator: PowerShell > Start-Service SSHD # C:\ Windows \ System32 Administrator: PowerShell > Start-Service SSHD # C:\ Windows \ System32 Administrator: PowerShell > Start-Service SSHD

3. Try the secret key link

in
The clientCreate a secret key pair according to the official tutorial in, and transfer the secret key to
The service side


Modify sshdC: ProgramData SSH ssh_config file

Match Group Administrators AuthorizedKeysFile __PROGRAMDATA__/ SSH # ModifiedMatch Group Administrators # AuthorizedKeysFile __programData__ / SSH # AuthorizedKeysFile __PROGRAMDATA__/ssh

At this point, the client can log in using both the secret key and the password at the same time. You can disable password login by setting PASSWORD AUTHENTICATION to NO