Cài đặt OpenSSH Server trên Windows
Xem thêm các chuyên mục:
Bạn có nhiều sự lựa chọn để cài đặt SSH Server cho Windows, dưới đây là một vài phần mềm SSH Server thông dụng và được ưa chuộng:
- OpenSSH Server
- FreeSSHd
Trong bài viết này tôi sẽ hướng dẫn bạn download và cài đặt OpenSSH Server trên Windows.
Yêu cầu Windows 8, Windows 2012 hoặc mới hơn.
![]()
Mặc dù trang chủ của OpenSSH là openssh.com, nhưng để download OpenSSH Server cho Windows, bạn phải download nó từ GitHub:

Sau khi download bạn có một file:

Giải nén file mà bạn đã download được ở bước trên ra một thư mục nào đó, chẳng hạn:
- C:/OpenSSH

Từ "Start Menu" mở CMD với quyền Administrator.

CD tới thư mục mà bạn vừa giải nén ra ở bước trên.

Cài đặt SSHD và ssh-agent services:
powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1


Tiếp theo, Tạo ra (generate) server keys bằng cách chạy lệnh (command) dưới đây:
ssh-keygen.exe -A


Tiếp theo, để cho phép xác thực khóa công khai (Public Keys), chạy lệnh:
powershell.exe -ExecutionPolicy Bypass -File install-sshlsa.ps1

Start OpenSSH Service:
Bạn đã cài đặt xong OpenSSH, tiếp theo bạn cần Start service:
- Control Panel > System and Security > Administrative Tools > Services

Tìm và khởi động "SSHD Services".


Mở cổng (port) 22 cho SSH Server trong Windows Firewall (Chỉ dành cho Windows 8, 2012 hoặc mới hơn):
New-NetFirewallRule -Protocol TCP -LocalPort 22 -Direction Inbound -Action Allow -DisplayName SSH

Hoặc trên Windows, thực hiện các bước:
- Control Panel > System and Security > Windows Firewall > Advanced Settings > Inbound Rules
- Add new Rule for port 22.







