Open basdp opened 9 years ago
Probably the same issue. I created a container with a sshd running. When I login, I get the following message:
PTY allocation request failed on channel 0 stdin: is not a tty
You can try passing -t I believe?
ssh -t 10.0.0.15 results in a direct disconnect after the "PTY allocation request failed on channel 0" message.
Okay, doing some more investigation: It seems that this line is the problem: 2>&1 | tee "$btrfs_path/$uuid/$uuid.log" If I remove that part, it seems to work correctly. Although, SSH is still experiencing the same issues.
$CGX:$uuid ip netns exec netns_"$uuid" "unshare" -fmuip --mount-proc "chroot" \
"$btrfs_path/$uuid" /bin/sh -c "/bin/mount -t proc proc /proc && $cmd" \
2>&1 | tee "$btrfs_path/$uuid/$uuid.log" || true
I'm on a roll!
I fixed the SSH issue by running this command in the container:
mount -t devpts none /dev/pts
@basdp Thanks for reporting this. It looks like tee
is blocking stdout, probably because the steam is still open. Will try and address this today or tomorrow.
It's probably worth mounting pts by default.
I don't run SSH in containers, can you suggest me a Docker image to test with with?
If still relevant, this one: https://hub.docker.com/r/evarga/jenkins-slave/
It looks like bocker run bash works, but there is no way I can get a prompt. Even 'export PS1="$ "' doesn't work. It is not that big of a problem, but I'm afraid this will just be the tip of the iceberg.