Typing password echoing in chrooted environment

I created chroot directory for SSH access. But after login, everything that requires password input (including mysql login) always echoing the password characters I typed. This is not a problem in host, only in chrooted environment. Please help how to turn off echo of the password.
 
This is FreeBSD 13.0-RELEASE-p4

And sshd_config for Match User:

Code:
ChrootDirectory /vusr
X11Forwarding no
AllowAgentForwarding no
AllowTcpForwarding no
 
I tried as follow (not real passwd):

Code:
# stty -echo
# mysql -u -p mysql
Enter password: @fo{k)@fk9

No changes, password still echoing.
Btw, the chroot was created with both bsdinstall jail /vusr and just simply SSH chroot. Both has same result. Password echoed.

Should /dev/ populated with tty* ?
 
I populated /dev/* with mount -t devfs devfs /vusr/dev

Now it has /dev/tty*

# stty -echo

Chroot into, and still password echoing.
 
stty -echo does not work for me either in chroot but mysql -h host -p wont echo if i have a dev
without a /dev will echo

somehow stty line discipline is not passed to the parent process but works inside the proc which sets it
i tested with a hacked version of stty and indeed the echo is turned off until stty exits
then it's back to normal
 
I think this only works if jail is running. I created the jail just for chroot with a complete FreeBSD dist, not for running jail itself and dont intend to run jail, that's where the problem occured i think. Long time ago when doing diskless, stty -echo works fine too.
 
I populated /dev/* with mount -t devfs devfs /srv/dev
Do you have /dev/pts?

pts is for pseudo ttys. I can't recall if mounting devfs includes that. Possibly SSH uses this.

What happens if you install and run tmux in the Jail / chroot? Can it run? Does the password still get echoed?
 
Yes /dev/pts is there. Inside jail (without jail runs)/chroot

Runs tmux:
open terminal failed: can't use /dev/pts/0
 
Back
Top