dounanyin3179 2018-05-07 08:58
浏览 215
已采纳

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?

  • 写回答

1条回答 默认 最新

  • dongmaqiu6084 2018-05-07 09:21
    关注

    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.
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部