通过这种方式执行command的时候:
ssh -q user@server <<EOF
command
EOF
会报error:
Pseudo-terminal will not be allocated because stdin is not a terminal.
解决办法:
加参数:-T
ssh -Tq user@server <<EOF
command
EOF
man 解释:
-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.
本文介绍了如何在使用SSH远程执行命令时避免分配伪终端,从而解决因标准输入不是终端而导致的问题。文中提供了具体的SSH命令参数调整方法。
8021

被折叠的 条评论
为什么被折叠?



