Windows安装SSH-Win32-OpenSSH

ssh config配置文件

C:\ProgramData\ssh
C:\ProgramData\ssh\sshd_config
%programdata%\ssh\sshd_config

配置 sshd_config

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Port 22
ListenAddress 0.0.0.0
SyslogFacility LOCAL0
LogLevel DEBUG
PubkeyAuthentication yes
PermitEmptyPasswords no
PasswordAuthentication no
AuthorizedKeysFile C:/Users/Administrator/.ssh/authorized_keys
IgnoreUserKnownHosts no
IgnoreRhosts yes
Subsystem sftp sftp-server.exe

PermitRootLogin yes
GSSAPIAuthentication no
PubkeyAcceptedKeyTypes=+ssh-rsa

安装 GIT 配置 authorized_keys

C:/Users/Administrator/.ssh/authorized_keys

ssh-keygen需要配置为ISA

1
2
3
4
5
6
7
8
9
10
ssh-keygen -t rsa -m PEM
ssh-keygen -t rsa -m PEM

Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa):
Enter passphrase for "/c/Users/Administrator/.ssh/id_rsa" (empty for no passphrase):
Enter same passphrase again:

Your identification has been saved in /c/Users/Administrator/.ssh/id_rsa
Your public key has been saved in /c/Users/Administrator/.ssh/id_rsa.pub