sshd: fix startWhenNeeded and listenAddresses combination
Previously, if startWhenNeeded was set, listenAddresses option was ignored and daemon was listening on all interfaces. Fixes #56325.
This commit is contained in:
@@ -400,7 +400,10 @@ in
|
||||
sockets.sshd =
|
||||
{ description = "SSH Socket";
|
||||
wantedBy = [ "sockets.target" ];
|
||||
socketConfig.ListenStream = cfg.ports;
|
||||
socketConfig.ListenStream = if cfg.listenAddresses != [] then
|
||||
map (l: "${l.addr}:${toString (if l.port != null then l.port else 22)}") cfg.listenAddresses
|
||||
else
|
||||
cfg.ports;
|
||||
socketConfig.Accept = true;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user