I have a DigitalOcean VPS with a single public IP address. I've created a very simple jail:
The
I have SSHed into the host. Now I start the jail, and enable sshd within it.
I would expect the jail to error at this point, saying that port 22 is taken. However it succeeds, and when I SSH to the host IP address, I get connected to the jail's SSHD!
This makes no sense to me at all. What am I misunderstanding about jail config, and how do I fix it? I certainly don't want to steal port 22 from the host!
Code:
test {
host.hostname = test;
ip4.addr = 1.2.3.4;
path = /jails/test;
exec.start = "/bin/sh /etc/rc";
exec.stop = "/bin/sh /etc/rc.shutdown";
}
The
ip4.addr
is the same IP as the host.I have SSHed into the host. Now I start the jail, and enable sshd within it.
I would expect the jail to error at this point, saying that port 22 is taken. However it succeeds, and when I SSH to the host IP address, I get connected to the jail's SSHD!
This makes no sense to me at all. What am I misunderstanding about jail config, and how do I fix it? I certainly don't want to steal port 22 from the host!