SSH未知的TTY错误消息
When trying to run the command ssh user@ip 'command'
, I keep receiving this error: can't get tty settingscan't set orig mode
. I have tried googling this and searching here but have not found anything referring to this message. I am trying to automate connecting to a Cisco wireless access point (2800 model) using Golang to run a command then exit, but this message pops up each time. I can log in normally using ssh user@ap_ip
, but using the shorthand ssh user@ap_ip 'command'
or trying the equivalent in Golang gives the error message above. Anyone know what's going on?
当尝试运行命令 ssh user @ ip'command' code>时,我一直收到 此错误:
无法获得tty设置无法设置原始模式 code>。 我已尝试使用Google搜索,并在此处进行搜索,但未找到与此消息相关的任何内容。 我正在尝试使用Golang自动连接到Cisco无线接入点(2800型)以运行命令,然后退出,但是每次都会弹出此消息。 我可以使用
ssh user @ ap_ip code>正常登录,但是使用速记
ssh user @ ap_ip'command' code>或尝试使用Golang中的等效命令会出现上述错误消息。 有人知道怎么回事吗? p>
div>
ssh without explicit command given will allocate a terminal while ssh with a command given will by default not. It looks like the command you execute needs a terminal. In this case use the -t
option, i.e. ssh -t user@ip command
. From the documentation:
-t Force pseudo-terminal 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.