You are not logged in.

#1 2014-03-20 10:51:07

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 355

[SOLVED] Why can't I use sshd immediately after enabling the socket?

I've noticed this on 2 installs already.  If I install openssh

# pacman -S openssh

and enable the socket:

# systemctl enable sshd.socket

I can't actually use ssh to connect to the system (the connection is refused) unless I also run:

# systemctl start sshd

However, after I reboot the system it works as advertised; i.e. no need to start the service.  I'm new to systemd -- am I missing something?  I haven't tried enabling the socket and immediately rebooting, but am assuming that just starting the service isn't persistent across reboots.

Last edited by pgoetz (2014-03-20 13:55:55)

Offline

#2 2014-03-20 10:57:31

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [SOLVED] Why can't I use sshd immediately after enabling the socket?

https://wiki.archlinux.org/index.php/Sy … sing_units

systemctl enable <servicename> indeed only activates said service the next time systemd is started (at bootup for example).
systemctl start <servicename> starts it right away.

All in all, working as intended in other words smile

Last edited by Gcool (2014-03-20 11:00:26)


Burninate!

Offline

#3 2014-03-20 11:01:19

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 355

Re: [SOLVED] Why can't I use sshd immediately after enabling the socket?

Thank you -- that's exactly what I needed to know.  I'll edit the Secure Shell wiki page to prevent this question from coming up again.

Offline

#4 2014-03-20 11:51:50

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED] Why can't I use sshd immediately after enabling the socket?

Note that you enabled sshd.socket (which was then started after a reboot), but when you manually started sshd, you didn't specify the exact unit name, meaning you actually started sshd.service instead of sshd.socket. Not a huge difference and it only lasts till the next reboot; just thought I'd point it out.

Offline

#5 2014-03-20 13:41:25

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 355

Re: [SOLVED] Why can't I use sshd immediately after enabling the socket?

Raynman wrote:

Note that you enabled sshd.socket (which was then started after a reboot), but when you manually started sshd, you didn't specify the exact unit name, meaning you actually started sshd.service instead of sshd.socket. Not a huge difference and it only lasts till the next reboot; just thought I'd point it out.

Thanks  -- I hadn't thought about it this carefully.  And even less of a difference given that I typically ssh to the machine 60-90 seconds later.  <:)

Unrelated:  I tried to mark the subject line with [SOLVED], but there seems to be a character limit which prevents me from adding any more characters?  If I mark it, the previous subject line will become unintelligible.

Offline

#6 2014-03-20 13:53:26

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,638
Website

Re: [SOLVED] Why can't I use sshd immediately after enabling the socket?

Try "[SOLVED] Why does systemctl not start sshd when I enable it", I think it captures the essence of the thread.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB