I have a problem in a second ssh-daemon(sshd) that worked perfectly and "service sshd-second status" it was shown as active in green letters. Everything worked perfectly.
This service was created before update from "yum update" and after update the service fails and is always "activating", sshd-second.pid is created and write to user/.ssh/known_hosts, sshd-second works every little time, but always restart without active service.
Who created it: "ExecStart=/usr/sbin/sshd -f /etc/ssh/sshd-second_config $ OPTIONS" into /usr/lib/systemd/system/sshd-second.service.
sshd.service (parent) works fine and without fail.
Typing cat /usr/lib/systemd/system/sshd-second.service
Code: Select all
[Unit]
Description=OpenSSH server second instance daemon
Documentation=man:sshd(8) man:sshd_config(5)
After=sshd-keygen.service sshd.service
Wants=sshd-keygen.service
[Service]
Type=forking
PidFile=/var/run/sshd-second.pid
EnvironmentFile=/etc/sysconfig/sshd
ExecStart=/usr/sbin/sshd -f /etc/ssh/sshd-second_config $OPTIONS
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartSec=42s
[Install]
WantedBy=multi-user.target
Code: Select all
Port 12345
ListenAddress 0.0.0.0
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
SyslogFacility AUTHPRIV
AllowUsers userdemo
PermitRootLogin no
MaxAuthTries 6
AuthorizedKeysFile .ssh/authorized_keys
PasswordAuthentication yes
ChallengeResponseAuthentication no
GSSAPIAuthentication yes
GSSAPICleanupCredentials no
UsePAM yes
X11Forwarding yes
UsePrivilegeSeparation sandbox # Default for new installations.
ClientAliveInterval 800
ClientAliveCountMax 0
PidFile=/var/run/sshd-second.pid
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS
Subsystem sftp /usr/libexec/openssh/sftp-server
Redirecting to /bin/systemctl reload sshd-second.service
Failed to reload sshd-second.service: Job type reload is not applicable for unit sshd-second.service.
See system logs and 'systemctl status sshd-second.service' for details.
Typing service sshd-second status
Redirecting to /bin/systemctl status sshd-second.service
sshd-second.service - OpenSSH server second instance daemon
Loaded: loaded (/usr/lib/systemd/system/sshd-second.service; enabled; vendor preset: disabled)
Active: activating (auto-restart) (Result: timeout) since mar 2017-09-26 02:05:20 CEST; 25s ago
Docs: man:sshd(8)
man:sshd_config(5)
Process: 1072 ExecStart=/usr/sbin/sshd -f /etc/ssh/sshd-second_config $OPTIONS (code=exited, status=0/SUCCESS)
sep 26 02:05:20 localhost.localdomain systemd[1]: Failed to start OpenSSH server second instance daemon.
sep 26 02:05:20 localhost.localdomain systemd[1]: Unit sshd-second.service entered failed state.
sep 26 02:05:20 localhost.localdomain systemd[1]: sshd-second.service failed.
Do you have any idea what may be happening? Should I go back to the openssh version not updated? What is the correct way to create a second sshd service after update centos7?
Thanks in advance.