在 Windows PowerShell 上连接到 OpenSSH 服务器

在 Windows PowerShell 上连接到 OpenSSH 服务器

按照本教程操作:https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=powershell

# Confirm the Firewall rule is configured. It should be created automatically by setup. Run the following to verify
if (!(Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue | Select-Object Name, Enabled)) {
    Write-Output "Firewall Rule 'OpenSSH-Server-In-TCP' does not exist, creating it..."
    New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
} else {
    Write-Output "Firewall rule 'OpenSSH-Server-In-TCP' has been created and exists."
}

至此以上几点,还可以。

下一步面临的障碍是

连接到 OpenSSH 服务器

这里运行此命令 ssh domain\username@servername:

PS> ssh WORKGROUP/Admin@redacted

给出以下输出:

 WORKGROUP/Admin@redacted: Permission denied (publickey,password,keyboard-interactive).

更新:这是我到目前为止尝试过的,但无济于事:

PS> ssh redacted@redacted
The authenticity of host 'redacted (redacted)' can't be established.
ED25519 key fingerprint is SHA256:[fingerprint].
Are you sure you want to continue connecting (yes/no/[fingerprint])? YES
Warning: Permanently added 'redacted' (ED25519) to the list of known hosts.
redacted@redacted's password:
Permission denied, please try again.
redacted@redacted's password:

更新2

PS C:\WINDOWS\system32>
PS C:\WINDOWS\system32> Set-LocalUser -Name "rishi" -Password 
(ConvertTo-SecureString -AsPlainText "923311" -Force)
PS C:\WINDOWS\system32> ssh rishi@LAPTOP-T6Q9PBVB
rishi@laptop-t6q9pbvb's password:
Permission denied, please try again.
rishi@laptop-t6q9pbvb's password:

相关内容