sshd vs. systemd-networkd

This forum is for discussion about general software issues.

sshd vs. systemd-networkd

Postby cmsigler » Wed Jun 08, 2016 12:18 am

Hi,

I have a problem with my two ALARM setups, one a RPi3, the other an Odroid-C2. I'm an old geezer so I use netctl on my i686 and x86_64 boxen and therefore have no reference.

In order to use a secondary ssh port available to both IPv4 and IPv6 (IPv4 only -- behind NAT -- for port 22), I'm using this sshd_config stanza:
$this->bbcode_second_pass_code('', 'Port 22
Port 1xxxx
ListenAddress 0.0.0.0
ListenAddress [2001:db8:aaaa:b::8]:1xxxx')
That's what I was able to come up with that worked when I did this config. My eth0.network code is:
$this->bbcode_second_pass_code('', '[Match]
Name=eth0

[Network]
DHCP=ipv4
IPv6PrivacyExtensions=true

[Address]
Address=2001:db8:aaaa:b::8/64')
The problem is that when the units reboot sshd can't bind to the IPv6 address/port. I get this in the sshd status:
$this->bbcode_second_pass_code('', 'Jun 07 21:03:55 alarm sshd[227]: error: Bind to port 1xxxx on 2001:db8:aaaa:b::8 failed: Cannot assign requested address.')
It binds to ports 22 and 1xxxx on 0.0.0.0 without problem (of course). NOTE: `systemctl reload sshd' fixes the problem first time every time so it looks like a race condition to me *shrug* For sshd.service I tried:
$this->bbcode_second_pass_code('', 'After=network-online.target')
but nothing changed. One thing I haven't tried is:
$this->bbcode_second_pass_code('', 'ListenAddress [::]:1xxxx')
but I'd rather not. Has anyone seen anything similar? What am I doing dumb to muck up my configs? It may be I just don't understand something about systemd-networkd. TIA.

Clemmitt
- Raspberry Pi 3
- Odroid-C2
- Raspberry Pi Zero
cmsigler
 
Posts: 37
Joined: Wed May 25, 2016 6:01 pm

Re: sshd vs. systemd-networkd

Postby cmsigler » Wed Jun 08, 2016 4:46 pm

Hi,

Using this in sshd_config:

$this->bbcode_second_pass_code('', 'ListenAddress [::]:1xxxx')
works fine upon reboot. Not sure why specifying the unit's correct static IPv6 address/port won't work.

Clemmitt
- Raspberry Pi 3
- Odroid-C2
- Raspberry Pi Zero
cmsigler
 
Posts: 37
Joined: Wed May 25, 2016 6:01 pm


Return to General

Who is online

Users browsing this forum: No registered users and 13 guests