Hi All,
How does ssh into an LXC container work?
I have a Centos 7.9 LXC container that I can ssh into, but I can't figure out what sshd is listening. systemctl start sshd fails with the complaint that it can't bind to port 22, and status shows it's disabled and dead. A third-party sshd also fails for the same reason.
netstat shows that the init process is binding port 22, but ps -ef|grep ssh shows no sshd process... until I try to connect...
When I connect, suddenly there is an sshd process, owned by init. Normally, I would see an sshd listener via ps -ef that looks like: /usr/sbin/sshd
Curiously, when I connect to this phantom sshd, I get prompted by putty to accept a new hostkey. So... something different is listening.
Now, if I kill -9 these init-based sshd's and then systemctl enable sshd, I'll get a normal listener.
What's frustrating is ps -ef of these phantom sshd's only shows "sshd: username" -- it won't show me the full path, so I can't figure out exactly what it is.
This is a brand-new LXC, and the behavior is repeatable across all of the LXC's that I create, so I have to assume it's something proxmox is doing... I just can't figure out what it is.
It's bonkers! Does proxmox start it's own sshd proxy listener or something for a container when it boots up? It looks like it, but I can't tie a process to it. And, if it does, how do I stop it?!?!? I need to be able to start a custom sshd listener within an LXC and that application can't run because something has port 22 bound.
Help Please!!!
How does ssh into an LXC container work?
I have a Centos 7.9 LXC container that I can ssh into, but I can't figure out what sshd is listening. systemctl start sshd fails with the complaint that it can't bind to port 22, and status shows it's disabled and dead. A third-party sshd also fails for the same reason.
netstat shows that the init process is binding port 22, but ps -ef|grep ssh shows no sshd process... until I try to connect...
When I connect, suddenly there is an sshd process, owned by init. Normally, I would see an sshd listener via ps -ef that looks like: /usr/sbin/sshd
Curiously, when I connect to this phantom sshd, I get prompted by putty to accept a new hostkey. So... something different is listening.
Now, if I kill -9 these init-based sshd's and then systemctl enable sshd, I'll get a normal listener.
What's frustrating is ps -ef of these phantom sshd's only shows "sshd: username" -- it won't show me the full path, so I can't figure out exactly what it is.
This is a brand-new LXC, and the behavior is repeatable across all of the LXC's that I create, so I have to assume it's something proxmox is doing... I just can't figure out what it is.
It's bonkers! Does proxmox start it's own sshd proxy listener or something for a container when it boots up? It looks like it, but I can't tie a process to it. And, if it does, how do I stop it?!?!? I need to be able to start a custom sshd listener within an LXC and that application can't run because something has port 22 bound.
Help Please!!!
Last edited: