ssh - Setting up OpenSSH for Windows using public key authentication -
i having issues setting openssh windows, using public key authentication.
i have working on local desktop , can ssh key unix machines or other openssh windows machines.
i have replicated build onto server, can password authentication working fine, when use keys following issue:
debug1: authentications can continue: publickey,password,keyboard-interactive debug3: start over, passed different list publickey,password,keyboard-interactive debug3: preferred publickey,keyboard-interactive,password debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive,password debug3: authmethod_is_enabled publickey debug1: next authentication method: publickey debug1: offering rsa public key: /cygdrive/c/sshusers/jsadmint2232/.ssh/id_rsa debug3: send_pubkey_test debug2: sent publickey packet, wait reply connection closed 127.0.0.1
so purposes of testing, have been trying ssh localhost, when tried remotely same issue.
even more strange, when have both password & public key enabled in sshd_config
, attempt use keys , bomb out above message , won't try use password.
here steps have taken:
- install openssh windows
- mkgroup -l >>..\etc\group (added local groups)
- mkgroup -d >>..\etc\group (added domain groups)
- mkpasswd -l -u openssh >>..\passwd (added local user)
- mkpasswd -d -u jsadmint2232 >>..\passwd (added domain user)
- edited homedir in passwd point c:\sshusers\%user% - %user% user name
- enabled password auth, disabled key auth
- created ssh keys both jsadmint2232 / openssh , ensured files created in homedirs
- added authorized_keys files .ssh dirs each user , added keys incoming connecting users
- net stop opensshd / net start opensshd
- test password auth works both locally , remotely
- updated sshd_config, enabled key auth - restart opensshd
- test connection , above error, doesn't try password auth?
- updated sshd_config, disable password auth - restart opensshd
- test connection , still above error
it appears server killing connection reason?
i have solved issue...
it related account started service - using local system account - stopping accessing pub key , authorized_keys file.
once stopped service , started user trying connect into, worked!
so basically, need start service account , external users connect in user.