jails OpenSSH server is only working while disabling pseudo-terminal allocation in Alpine Linux jail

I've already setup a working Devuan Linux jail running many services including OpenSSH server but, out of curiosity, I wanted to try another Linux distribution. Since systemd doesn't work well with jails, it narrows the possibilities quite a bit so I ended up with Alpine Linux. On their website, a "mini root filesystem" can be downloaded and be used directly as a jail but, personally, I opted for generating an image via a freshly installed LXC container on my physical Linux server as it seems more complete. On my physical FreeBSD host, I managed to get the jail working after searching a bit for the value of exec.start ("/sbin/openrc boot") and exec.stop ("/sbin/openrc shutdown") parameters inside /etc/jail.conf. After installing OpenSSH server, I start the service but, even though the sshd process is present, I can't connect to it as I always get "Connection to X closed by remote host.". For getting more info, I wanted to enable debug logs on server side but since syslog/rsyslog doesn't seem to work in Linux jails, I had to make sshd log directly to a file. After setting "LogLevel VERBOSE" in /etc/ssh/sshd_config, I added this to /etc/conf.d/sshd :

Code:
command_args="-E /var/log/auth.log"

After that, I restart sshd service and get the following message in logs when I try to connect:

Code:
openpty returns device for which ttyname fails.

If I connect to the jail with "ssh -T", it works (I can execute commands) but I get no prompt.

I would like to make sshd working completely since it works in my Devuan jail... I've googled a bit with the above error and it pointed to chroot environments with no /proc but this is not the case here since I mounted linprocfs into /proc of my jail.
 
Back
Top