Having problems with /etc/ssh/sshd_config

,

Does anyone have the vps ssh config file that I can copy? I set the config file as per htb academy but I am getting a message that says “code=exited , status=255,exception” , I set it as suggested in the setting up VPS but I can not get ssh to start now. When I was making the suggested settings I noticed the config file was missing a few things like “Protocol” “AuthorizedUsers” and “AuthenticationMethods publickey,keyboard-interactive” and I am not sure where to add these to my config file? I may have made other mistakes but I am not sure

Whats the output of journalctl -b?

Mar 15 12:41:10 ubuntu-test-server systemd[2300]: Queued start job for default target Main User Target.
Mar 15 12:41:10 ubuntu-test-server systemd[2300]: Created slice User Application Slice.
Mar 15 12:41:10 ubuntu-test-server systemd[2300]: Created slice User Core Session Slice.
Mar 15 12:41:10 ubuntu-test-server systemd[2300]: Reached target Paths.
Mar 15 12:41:10 ubuntu-test-server systemd[2300]: Reached target Timers.
Mar 15 12:41:10 ubuntu-test-server systemd[2300]: Starting D-Bus User Message Bus Socket...
Mar 15 12:41:10 ubuntu-test-server systemd[2300]: Listening on GnuPG network certificate management daemon.
Mar 15 12:41:10 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] AppArmor D-Bus mediation is enabled
Mar 15 12:41:10 ubuntu-test-server systemd[2300]: Listening on GnuPG cryptographic agent and passphrase cache (access for web browsers).
Mar 15 12:41:10 ubuntu-test-server systemd[2300]: Listening on GnuPG cryptographic agent and passphrase cache (restricted).
Mar 15 12:41:10 ubuntu-test-server systemd[2300]: Listening on GnuPG cryptographic agent (ssh-agent emulation).
Mar 15 12:41:10 ubuntu-test-server systemd[2300]: Listening on GnuPG cryptographic agent and passphrase cache.
Mar 15 12:41:10 ubuntu-test-server systemd[2300]: Listening on PipeWire Multimedia System Socket.
Mar 15 12:41:10 ubuntu-test-server systemd[2300]: Listening on debconf communication socket.
Mar 15 12:41:10 ubuntu-test-server systemd[2300]: Listening on Sound System.
Mar 15 12:41:10 ubuntu-test-server systemd[2300]: Listening on REST API socket for snapd user session agent.
Mar 15 12:41:10 ubuntu-test-server systemd[2300]: Listening on D-Bus User Message Bus Socket.
Mar 15 12:41:10 ubuntu-test-server systemd[2300]: Reached target Sockets.
Mar 15 12:41:10 ubuntu-test-server systemd[2300]: Reached target Basic System.
Mar 15 12:41:10 ubuntu-test-server systemd[2300]: Started PipeWire Multimedia Service.
Mar 15 12:41:10 ubuntu-test-server systemd[2300]: Started PipeWire Media Session Manager.
Mar 15 12:41:10 ubuntu-test-server systemd[2300]: Starting Sound Service...
Mar 15 12:41:10 ubuntu-test-server systemd[2300]: Started D-Bus User Message Bus.
Mar 15 12:41:11 ubuntu-test-server systemd[2300]: Started Sound Service.
Mar 15 12:41:11 ubuntu-test-server systemd[2300]: Reached target Main User Target.
Mar 15 12:41:11 ubuntu-test-server systemd[2300]: Startup finished in 454ms.
Mar 15 12:41:12 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating via systemd: service name='org.gtk.vfs.Daemon' unit='gvfs-daemon.service' requested by ':1.8' (uid=1000 pid=2403 comm="/usr/bin/ibus-daemon --daemonize --xim " label="unconfined")
Mar 15 12:41:12 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.gtk.vfs.Daemon'
Mar 15 12:41:12 ubuntu-test-server systemd[2300]: Starting Virtual filesystem service...
Mar 15 12:41:12 ubuntu-test-server systemd[2300]: Started Virtual filesystem service.
Mar 15 12:41:12 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating service name='org.freedesktop.portal.IBus' requested by ':1.8' (uid=1000 pid=2403 comm="/usr/bin/ibus-daemon --daemonize --xim " label="unconfined")
Mar 15 12:41:12 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.freedesktop.portal.IBus'
Mar 15 12:41:12 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating via systemd: service name='org.a11y.Bus' unit='at-spi-dbus-bus.service' requested by ':1.17' (uid=1000 pid=2423 comm="/usr/libexec/ibus-extension-gtk3 " label="unconfined")
Mar 15 12:41:12 ubuntu-test-server systemd[2300]: Starting Accessibility services bus...
Mar 15 12:41:12 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.a11y.Bus'
Mar 15 12:41:12 ubuntu-test-server systemd[2300]: Started Accessibility services bus.
Mar 15 12:41:12 ubuntu-test-server at-spi-bus-launcher[2447]: dbus-daemon[2447]: Activating service name='org.a11y.atspi.Registry' requested by ':1.2' (uid=1000 pid=2426 comm="/usr/libexec/ibus-x11 --kill-daemon " label="unconfined")
Mar 15 12:41:12 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating via systemd: service name='org.freedesktop.portal.Desktop' unit='xdg-desktop-portal.service' requested by ':1.12' (uid=1000 pid=2423 comm="/usr/libexec/ibus-extension-gtk3 " label="unconfined")
Mar 15 12:41:12 ubuntu-test-server at-spi-bus-launcher[2447]: dbus-daemon[2447]: Successfully activated service 'org.a11y.atspi.Registry'
Mar 15 12:41:12 ubuntu-test-server at-spi-bus-launcher[2452]: SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry
Mar 15 12:41:12 ubuntu-test-server systemd[2300]: Starting Portal service...
Mar 15 12:41:13 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating via systemd: service name='org.freedesktop.portal.Documents' unit='xdg-document-portal.service' requested by ':1.24' (uid=1000 pid=2457 comm="/usr/libexec/xdg-desktop-portal " label="unconfined")
Mar 15 12:41:13 ubuntu-test-server systemd[2300]: Starting flatpak document portal service...
Mar 15 12:41:13 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating via systemd: service name='org.freedesktop.impl.portal.PermissionStore' unit='xdg-permission-store.service' requested by ':1.25' (uid=1000 pid=2468 comm="/usr/libexec/xdg-document-portal " label="unconfined")
Mar 15 12:41:13 ubuntu-test-server systemd[2300]: Starting sandboxed app permission store...
Mar 15 12:41:13 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.freedesktop.impl.portal.PermissionStore'
Mar 15 12:41:13 ubuntu-test-server systemd[2300]: Started sandboxed app permission store.
Mar 15 12:41:13 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.freedesktop.portal.Documents'
Mar 15 12:41:13 ubuntu-test-server systemd[2300]: Started flatpak document portal service.
Mar 15 12:41:13 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating via systemd: service name='org.freedesktop.impl.portal.desktop.gtk' unit='xdg-desktop-portal-gtk.service' requested by ':1.24' (uid=1000 pid=2457 comm="/usr/libexec/xdg-desktop-portal " label="unconfined")
Mar 15 12:41:13 ubuntu-test-server systemd[2300]: Starting Portal service (GTK/GNOME implementation)...
Mar 15 12:41:13 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.freedesktop.impl.portal.desktop.gtk'
Mar 15 12:41:13 ubuntu-test-server systemd[2300]: Started Portal service (GTK/GNOME implementation).
Mar 15 12:41:13 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating via systemd: service name='ca.desrt.dconf' unit='dconf.service' requested by ':1.14' (uid=1000 pid=2318 comm="mate-session " label="unconfined")
Mar 15 12:41:13 ubuntu-test-server systemd[2300]: Starting User preferences database...
Mar 15 12:41:13 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'ca.desrt.dconf'
Mar 15 12:41:13 ubuntu-test-server systemd[2300]: Started User preferences database.
Mar 15 12:41:13 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating service name='org.freedesktop.secrets' requested by ':1.24' (uid=1000 pid=2457 comm="/usr/libexec/xdg-desktop-portal " label="unconfined")
Mar 15 12:41:13 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.freedesktop.secrets'
Mar 15 12:41:13 ubuntu-test-server mate-session[2318]: WARNING: Unable to find provider '' of required component 'dock'
Mar 15 12:41:13 ubuntu-test-server gnome-keyring-daemon[2313]: The Secret Service was already initialized
Mar 15 12:41:13 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.freedesktop.portal.Desktop'
Mar 15 12:41:13 ubuntu-test-server systemd[2300]: Started Portal service.
Mar 15 12:41:14 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating via systemd: service name='org.gtk.vfs.UDisks2VolumeMonitor' unit='gvfs-udisks2-volume-monitor.service' requested by ':1.33' (uid=1000 pid=2543 comm="/usr/bin/mate-settings-daemon " label="unconfined")
Mar 15 12:41:14 ubuntu-test-server systemd[2300]: Starting Virtual filesystem service - disk device monitor...
Mar 15 12:41:14 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.gtk.vfs.UDisks2VolumeMonitor'
Mar 15 12:41:14 ubuntu-test-server systemd[2300]: Started Virtual filesystem service - disk device monitor.
Mar 15 12:41:14 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating via systemd: service name='org.gtk.vfs.AfcVolumeMonitor' unit='gvfs-afc-volume-monitor.service' requested by ':1.33' (uid=1000 pid=2543 comm="/usr/bin/mate-settings-daemon " label="unconfined")
Mar 15 12:41:14 ubuntu-test-server systemd[2300]: Starting Virtual filesystem service - Apple File Conduit monitor...
Mar 15 12:41:14 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.gtk.vfs.AfcVolumeMonitor'
Mar 15 12:41:14 ubuntu-test-server systemd[2300]: Started Virtual filesystem service - Apple File Conduit monitor.
Mar 15 12:41:14 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating via systemd: service name='org.gtk.vfs.MTPVolumeMonitor' unit='gvfs-mtp-volume-monitor.service' requested by ':1.33' (uid=1000 pid=2543 comm="/usr/bin/mate-settings-daemon " label="unconfined")
Mar 15 12:41:14 ubuntu-test-server systemd[2300]: Starting Virtual filesystem service - Media Transfer Protocol monitor...
Mar 15 12:41:14 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.gtk.vfs.MTPVolumeMonitor'
Mar 15 12:41:14 ubuntu-test-server systemd[2300]: Started Virtual filesystem service - Media Transfer Protocol monitor.
Mar 15 12:41:14 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating via systemd: service name='org.gtk.vfs.GoaVolumeMonitor' unit='gvfs-goa-volume-monitor.service' requested by ':1.33' (uid=1000 pid=2543 comm="/usr/bin/mate-settings-daemon " label="unconfined")
Mar 15 12:41:14 ubuntu-test-server systemd[2300]: Starting Virtual filesystem service - GNOME Online Accounts monitor...
Mar 15 12:41:14 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating service name='org.gnome.OnlineAccounts' requested by ':1.41' (uid=1000 pid=2716 comm="/usr/libexec/gvfs-goa-volume-monitor " label="unconfined")
Mar 15 12:41:15 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating service name='org.mate.panel.applet.WnckletFactory' requested by ':1.37' (uid=1000 pid=2677 comm="mate-panel " label="unconfined")
Mar 15 12:41:15 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating service name='org.mate.panel.applet.TrashAppletFactory' requested by ':1.37' (uid=1000 pid=2677 comm="mate-panel " label="unconfined")
Mar 15 12:41:15 ubuntu-test-server gnome-keyring-daemon[2313]: The PKCS#11 component was already initialized
Mar 15 12:41:15 ubuntu-test-server gnome-keyring-daemon[2313]: The Secret Service was already initialized
Mar 15 12:41:15 ubuntu-test-server gnome-keyring-daemon[2313]: The SSH agent was already initialized
Mar 15 12:41:15 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.mate.panel.applet.TrashAppletFactory'
Mar 15 12:41:15 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.mate.panel.applet.WnckletFactory'
Mar 15 12:41:16 ubuntu-test-server goa-daemon[2720]: goa-daemon version 3.44.0 starting
Mar 15 12:41:16 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating service name='org.gnome.Identity' requested by ':1.52' (uid=1000 pid=2720 comm="/usr/libexec/goa-daemon " label="unconfined")
Mar 15 12:41:16 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.gnome.OnlineAccounts'
Mar 15 12:41:16 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.gtk.vfs.GoaVolumeMonitor'
Mar 15 12:41:16 ubuntu-test-server systemd[2300]: Started Virtual filesystem service - GNOME Online Accounts monitor.
Mar 15 12:41:16 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating via systemd: service name='org.gtk.vfs.GPhoto2VolumeMonitor' unit='gvfs-gphoto2-volume-monitor.service' requested by ':1.33' (uid=1000 pid=2543 comm="/usr/bin/mate-settings-daemon " label="unconfined")
Mar 15 12:41:16 ubuntu-test-server systemd[2300]: Starting Virtual filesystem service - digital camera monitor...
Mar 15 12:41:16 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.gnome.Identity'
Mar 15 12:41:16 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.gtk.vfs.GPhoto2VolumeMonitor'
Mar 15 12:41:16 ubuntu-test-server systemd[2300]: Started Virtual filesystem service - digital camera monitor.
Mar 15 12:41:16 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating via systemd: service name='org.gnome.evolution.dataserver.Sources5' unit='evolution-source-registry.service' requested by ':1.54' (uid=1000 pid=2783 comm="/usr/libexec/evolution-data-server/evolution-alarm" label="unconfined")
Mar 15 12:41:16 ubuntu-test-server systemd[2300]: Starting Evolution source registry...
Mar 15 12:41:17 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.gnome.evolution.dataserver.Sources5'
Mar 15 12:41:17 ubuntu-test-server systemd[2300]: Started Evolution source registry.
Mar 15 12:41:17 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating service name='org.mate.panel.applet.MultiLoadAppletFactory' requested by ':1.37' (uid=1000 pid=2677 comm="mate-panel " label="unconfined")
Mar 15 12:41:17 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating service name='org.mate.panel.applet.ClockAppletFactory' requested by ':1.37' (uid=1000 pid=2677 comm="mate-panel " label="unconfined")
Mar 15 12:41:17 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating service name='org.mate.panel.applet.NotificationAreaAppletFactory' requested by ':1.37' (uid=1000 pid=2677 comm="mate-panel " label="unconfined")
Mar 15 12:41:18 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.mate.panel.applet.MultiLoadAppletFactory'
Mar 15 12:41:18 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.mate.panel.applet.ClockAppletFactory'
Mar 15 12:41:18 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.mate.panel.applet.NotificationAreaAppletFactory'
Mar 15 12:41:18 ubuntu-test-server clock-applet[2849]: Negative content width -9 (allocation 1, extents 5x5) while allocating gadget (node button, owner GtkToggleButton)
Mar 15 12:41:18 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating via systemd: service name='org.gnome.evolution.dataserver.Calendar8' unit='evolution-calendar-factory.service' requested by ':1.54' (uid=1000 pid=2783 comm="/usr/libexec/evolution-data-server/evolution-alarm" label="unconfined")
Mar 15 12:41:18 ubuntu-test-server systemd[2300]: Starting Evolution calendar service...
Mar 15 12:41:18 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.gnome.evolution.dataserver.Calendar8'
Mar 15 12:41:18 ubuntu-test-server systemd[2300]: Started Evolution calendar service.
Mar 15 12:41:18 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Activating via systemd: service name='org.gnome.evolution.dataserver.AddressBook10' unit='evolution-addressbook-factory.service' requested by ':1.62' (uid=1000 pid=2914 comm="/usr/libexec/evolution-calendar-factory " label="unconfined")
Mar 15 12:41:18 ubuntu-test-server systemd[2300]: Starting Evolution address book service...
Mar 15 12:41:19 ubuntu-test-server dbus-daemon[2310]: [session uid=1000 pid=2310] Successfully activated service 'org.gnome.evolution.dataserver.AddressBook10'
Mar 15 12:41:19 ubuntu-test-server systemd[2300]: Started Evolution address book service.
Mar 15 12:41:36 ubuntu-test-server pulseaudio[2309]: GetManagedObjects() failed: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Mar 15 16:27:20 ubuntu-test-server mate-screensaver-dialog[3246]: gkr-pam: unlocked login keyring
Mar 15 16:27:32 ubuntu-test-server wnck-applet[2725]: Negative content width -1 (allocation 1, extents 1x1) while allocating gadget (node button, owner WnckButton)
Mar 15 16:53:54 ubuntu-test-server sudo[3402]: warloxian : TTY=pts/0 ; PWD=/home/warloxian ; USER=root ; COMMAND=/usr/bin/systemctl start ssh
Mar 15 16:53:54 ubuntu-test-server sudo[3402]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)
Mar 15 16:53:54 ubuntu-test-server sudo[3402]: pam_unix(sudo:session): session closed for user root
Mar 15 16:54:37 ubuntu-test-server sudo[3415]: warloxian : TTY=pts/0 ; PWD=/home/warloxian ; USER=root ; COMMAND=/usr/bin/nano /etc/ssh/sshd_config
Mar 15 16:54:37 ubuntu-test-server sudo[3415]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)
Mar 15 16:55:50 ubuntu-test-server sudo[3415]: pam_unix(sudo:session): session closed for user root
Mar 15 16:56:04 ubuntu-test-server sudo[3420]: warloxian : TTY=pts/0 ; PWD=/home/warloxian ; USER=root ; COMMAND=/usr/bin/journalctl -b
Mar 15 16:56:04 ubuntu-test-server sudo[3420]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)
Mar 15 16:57:42 ubuntu-test-server sudo[3420]: pam_unix(sudo:session): session closed for user root

I am obviously new"ish" at this. I have been teaching myself Linux between two jobs over the last few months. I went into the config file as per HTB vps hardening and changed or added the items that were in the instructions. Now I noticed a few items were not already in the config file and i was not 100% sure where to add them. The biggest problem I may have is that I am not sure if I inadvertently un-commented something that shouldn’t have been. Since I do not have a good copy of the original file, I do not have anything to fall back on. I have not learned how to backup and restore config files yet. I guess I should make that a priority .

I went back through everything and made a couple changes and SSH is fully functional now with TFA. Thanks to anyone that spent time helping me