Win Server2019安装SSH sftp

Win Server2019安装SSH sftp

1.下载微软官方的open-Ssh

从GitHub上下载Open-SSH

2.解压到一个盘中 并把文件夹重命名为OpenSSH

3.配置环境变量

image-20200512111754510

4.安装Open-SSH

install-sshd.ps1 使用这个脚本安装(需要用管理员运行)

5.生成密钥

ssh-keygen -t rsa -C “[email protected]

6.查看生成的密钥

more .ssh.pub

7.为SSHD服务启用自动启动,然后使用以下PowerShell服务管理命令启动它:

Set-Service -Name sshd -StartupType ‘Automatic’

Start-Service sshd

8.开启防火墙

New-NetFirewallRule -Protocol TCP -LocalPort 22 -Direction Inbound -Action Allow -DisplayName SSH

猜你喜欢

转载自www.cnblogs.com/liwenqian/p/12914918.html