0

CentOS 7. Here's /usr/lib/systemd/system/sshd.service

[Unit]
Description=OpenSSH server daemon
Documentation=man:sshd(8) man:sshd_config(5)
After=network.target sshd-keygen.service
Wants=sshd-keygen.service

[Service]
Type=notify
EnvironmentFile=/etc/sysconfig/sshd
ExecStart=/usr/sbin/sshd -D $OPTIONS
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartSec=42s

[Install]
WantedBy=multi-user.target

Everything that is uncommented in sshd_config:

HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
SyslogFacility AUTHPRIV
AuthorizedKeysFile.ssh/authorized_keys
PasswordAuthentication yes
ChallengeResponseAuthentication no
GSSAPIAuthentication yes
GSSAPICleanupCredentials no
usePAM no # Had to change it to no from yes because the connection was dropping right after successfull auth
X11Forwarding yes
Subsystemsftp/usr/libexec/openssh/sftp-server

Anything else I'm happy to provide if needed. Appreciate your help!

debugman
  • 1
  • 1

1 Answers1

0

Looks like you have a typo there in your sshd_config

Subsystemsftp/usr/libexec/openssh/sftp-server

Should be

Subsystem sftp /usr/libexec/openssh/sftp-server

And this

AuthorizedKeysFile.ssh/authorized_keys

Should be

AuthorizedKeysFile .ssh/authorized_keys

Furthermore, do a syntax check of your config

sshd -t 
Alex
  • 276
  • 1
  • 5