#[SOLVED] sshd is not working on ubuntu server

15 messages · Page 1 of 1 (latest)

gilded heath
#

Ive tried purging openssh-server and reinstalling but I have the same issue, i really would like to protect the newly created mail server!

  ssh.service                                           loaded    active   running OpenBSD Secure Shell server
● sshd-keygen.service                                   not-found inactive dead    sshd-keygen.service
● sshd.service                                          not-found inactive dead    sshd.service```

```mailserver@exulan:~$ sudo systemctl restart sshd
[sudo] password for mailserver:
Failed to restart sshd.service: Unit sshd.service not found.```

This happens fresh out of the box too, you press the option to install openssh-server on install and it should bloody work!
pallid plover
#

does this happen with other distros btw?

#

i recommend debian over anything for servers

gilded heath
#

i havent had it happen with others but i was following a ubuntu based tutorial so i thought i would just use ubuntu server

pallid plover
#

debian should work too

#

https://landchad.net/ you can check this out for more guides

#

anyhow

gilded heath
#

its taken me like a day and a half to get the mail server working fully so i dont really wanna switch to another distro lol

pallid plover
#

i dont really know whats going on here, as i have not used ubuntu in forever, just giving my thoughts

#

ill look into it rq

gilded heath
#

would be nice to know to fix this anyway when i do need ubuntu server in the future for any reason and it does this shit again

gilded heath
# pallid plover i dont really know whats going on here, as i have not used ubuntu in forever, ju...

right figured it out!

https://discourse.ubuntu.com/t/sshd-now-uses-socket-based-activation-ubuntu-22-10-and-later/30189/30

Ubuntu after 2022 uses socket for ssh instead of service so sshd isnt activated and thus changing the sshd_config file wont work

to fix that you gotta run these commands

rm -f /etc/systemd/system/ssh.service.d/00-socket.conf
rm -f /etc/systemd/system/ssh.socket.d/addresses.conf
systemctl daemon-reload
systemctl enable --now ssh.service```

everything was changing after that, awesome! but `PasswordAuthentication no` was not taking effect, for some reason there was an overriding file in `/etc/ssh/sshd_config.d/` named `50-cloud-init.conf` so i removed that and well pub/private key auth works now!

idk ubuntu changed all this, very annoying
pallid plover
#

ubuntu moment of all time

#

... solved

old willowBOT
#

#9742 📣 If there is nothing else that we can do for you, please close this thread by adding "[SOLVED]" to the title.

  • You can do this on desktop by clicking the three dots on the top right of the page, and pressing "Edit Post".
  • You can also do this on Android / iOS by long tapping your post in the text channel list, and tapping "Edit Post".

Your title should be like so: https://cdn.discordapp.com/attachments/503224329191030787/1039841700417384498/image.png
Thank you