Skip to content

Instantly share code, notes, and snippets.

@AlexKalinin
Forked from fengli320/sshd_gitbash.sh
Created February 28, 2022 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexKalinin/e5695074a5e06b13e97d94380512af4f to your computer and use it in GitHub Desktop.
Save AlexKalinin/e5695074a5e06b13e97d94380512af4f to your computer and use it in GitHub Desktop.
How to setup SSHD in Git Bash
# Precondition: Git for Windows 2.9.0 + Windows 7, other version of Git for Windows & Windows XP and Windows 10 should also be supported
# In /etc/ssh/sshd_config, set UsePrivilegeSeparation to no
# You can also change other settings of SSHD like port in this file
# Generate key pairs
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -q -N ""
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -q -N ""
ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -q -N ""
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -q -N ""
# Start SSHD
/usr/bin/sshd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment