Today I cannot log in my Oracle ubuntu server via SSH. I use the console connection function in Oracle and launch a cloud shell connection to trouble shoot. I tried systemctl restart ssh but it says
Job for ssh.service failed because the control process exited with error code.
See "systemctl status ssh.service" and "journalctl -xe" for details.
Upon using systemctl status ssh, here's the response
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: e>
Active: failed (Result: exit-code) since Tue 2024-08-20 18:20:06 UTC; 22s >
Docs: man:sshd(8)
man:sshd_config(5)
Process: 2008 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=1/FAILURE)
Aug 20 18:20:06 server-1 systemd[1]: ssh.service: Scheduled restart job, restar>
Aug 20 18:20:06 server-1 systemd[1]: Stopped OpenBSD Secure Shell server.
Aug 20 18:20:06 server-1 systemd[1]: ssh.service: Start request repeated too qu>
Aug 20 18:20:06 server-1 systemd[1]: ssh.service: Failed with result 'exit-code>
Aug 20 18:20:06 server-1 systemd[1]: Failed to start OpenBSD Secure Shell serve>
Entering journalctl -xe, here's the response
-- Subject: A stop job for unit ssh.service has finished
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A stop job for unit ssh.service has finished.
--
-- The job identifier is 1837 and the job result is done.
Aug 20 18:20:06 server-1 systemd[1]: ssh.service: Start request repeated too qu>
Aug 20 18:20:06 server-1 systemd[1]: ssh.service: Failed with result 'exit-code>
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit ssh.service has entered the 'failed' state with result 'exit-code'.
Aug 20 18:20:06 server-1 systemd[1]: Failed to start OpenBSD Secure Shell serve>
-- Subject: A start job for unit ssh.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit ssh.service has finished with a failure.
--
-- The job identifier is 1837 and the job result is failed.
Anyone knows what's the issue here ?
Additional information
I have not modified any lines in
/etc/ssh/sshd_configand/etc/systemd/system/sshd.service, I double check these by setting up a new instance where ssh connection is working and compare line by line for both files. Also, these 2 instances use the same security list where required ports are opened. I use default Port 22 for SSH.I discover I cannot login ssh using Putty after installing a new docker container, but they seem not to be correlated as later I did the same thing on my new instance, and SSH connection is still working fine for the instance
All my docker containers are exited before using the above codes to check ssh status
Edit 1
Enter /usr/sbin/sshd -ddd, receive below debug log, replace private host keys characters with *
debug2: load_server_config: filename /etc/ssh/sshd_config
debug2: load_server_config: done config len = 342
debug2: parse_server_config_depth: config /etc/ssh/sshd_config len 342
debug2: /etc/ssh/sshd_config line 13: new include /etc/ssh/sshd_config.d/*.conf
debug2: /etc/ssh/sshd_config line 13: no match for /etc/ssh/sshd_config.d/*.conf
debug3: /etc/ssh/sshd_config:63 setting ChallengeResponseAuthentication yes
debug3: /etc/ssh/sshd_config:86 setting UsePAM yes
debug3: /etc/ssh/sshd_config:91 setting X11Forwarding yes
debug3: /etc/ssh/sshd_config:95 setting PrintMotd no
debug3: /etc/ssh/sshd_config:113 setting AcceptEnv LANG LC_*
debug3: /etc/ssh/sshd_config:116 setting Subsystem sftp /usr/lib/openssh/sftp-server
debug3: checking syntax for 'Match User ******'
debug1: sshd version OpenSSH_8.2, OpenSSL 1.1.1f 31 Mar 2020
debug1: private host key #0: *****************
debug1: private host key #1: *****************
debug1: private host key #2: *****************
debug1: setgroups() failed: Operation not permitted
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-ddd'
debug3: oom_adjust_setup
debug1: Set /proc/self/oom_score_adj from 0 to -1000
debug2: fd 3 setting O_NONBLOCK
debug1: Bind to port 22 on 0.0.0.0.
Bind to port 22 on 0.0.0.0 failed: Permission denied.
debug2: fd 3 setting O_NONBLOCK
debug3: sock_set_v6only: set socket 3 IPV6_V6ONLY
debug1: Bind to port 22 on ::.
Bind to port 22 on :: failed: Permission denied.
Cannot bind any address.
sudo /usr/sbin/sshd -T) provides any further information about the failure – steeldriver Aug 21 '24 at 15:10/usr/sbin/sshd -T, it gives a long list of my SSH configuration, what should I look for specifically ? – plvcii36 Aug 21 '24 at 16:00/etc/ssh/sshd_config.d/? – steeldriver Aug 21 '24 at 17:15sshd_configis located in/etc/ssh/, there are for sure other files under that directory too. Additionally, I tried/usr/sbin/sshd -dddand got the debug log, I'll put them in the original post above as there are characters limit in this comment section – plvcii36 Aug 21 '24 at 19:08