我希望能够通过桌面上的单个ssh命令在远程服务器上启动屏幕会话.但是,屏幕似乎需要一个终端,当通过ssh运行命令时,该终端不可用.
所以很明显
ssh root@my.machine screen "tail -f /var/log/messages"
(作为一个例子)不起作用,并给出
Must be connected to a terminal.
我希望ssh在屏幕下启动命令,这样我就可以稍后登录并按照我想要的方式连接到手动启动的屏幕会话.
解决方法
尝试使用-t选项ssh
ssh -t root@my.machine screen "tail -f /var/log/messages"
从男人ssh
-t Force pseudo-tty allocation. This can be used to execute arbi- trary 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.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。