Lars Noodén
2023-Feb-05 15:14 UTC
The -p option for sshd(8) seems to be ignored in OpenSSH_9.2
Greetings. It used to be possible to spin up additional instances of sshd(8) next to an established process with options to override the configuration file. However, in the most recent version of sshd(8) in the OpenBSD snapshot for amd64 does not do that any more as it seems to not accept a new port assignment and ends up conflicting with the already running service: # /usr/sbin/sshd -p 2201 -d debug1: sshd version OpenSSH_9.2, LibreSSL 3.7.1 debug1: private host key #0: ssh-rsa SHA256:7tXl2Q... debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:t9pNvmtPBL1aF... debug1: private host key #2: ssh-ed25519 SHA256:T0IGk... debug1: rexec_argv[0]='/usr/sbin/sshd' debug1: rexec_argv[1]='-p' debug1: rexec_argv[2]='2201' debug1: rexec_argv[3]='-d' debug1: Bind to port 22 on 10.100.100.1. Bind to port 22 on 10.100.100.1 failed: Address already in use. debug1: Bind to port 2223 on 0.0.0.0. Bind to port 2223 on 0.0.0.0 failed: Address already in use. Cannot bind any address. # /usr/sbin/sshd -V OpenSSH_9.2, LibreSSL 3.7.1 Regards, Lars
Darren Tucker
2023-Feb-05 21:44 UTC
The -p option for sshd(8) seems to be ignored in OpenSSH_9.2
On Mon, 6 Feb 2023 at 02:23, Lars Nood?n <lars.nooden at gmx.com> wrote:> debug1: Bind to port 22 on 10.100.100.1. > Bind to port 22 on 10.100.100.1 failed: Address already in use.This line implies that you have at least one ListenAddress directive in your sshd_config and -p doesn't override those: -p port Specifies the port on which the server listens for connections (default 22). Multiple port options are permitted. Ports specified in the configuration file with the Port option are ignored when a command-line port is specified. *Ports specified using the ListenAddress option override command-line ports.* What ListenAddress and Port directives do you have in your sshd_config? -- Darren Tucker (dtucker at dtucker.net) GPG key 11EAA6FA / A86E 3E07 5B19 5880 E860 37F4 9357 ECEF 11EA A6FA (new) Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement.