尝试ssh -t -t
(或ssh -tt
简称)强制伪tty分配,即使stdin不是终端。
从ssh联机帮助页:
-T Disable pseudo-tty allocation.
-t Force pseudo-tty allocation. This can be used to execute arbitrary
screen-based programs on a remote machine, which can be very useful,
e.g. when implementing menu services. Multiple -t options force tty
allocation, even if ssh has no local tty.