[英]Getting stty: standard input: Inappropriate ioctl for device when using scp through an ssh tunnel
根據標題,當我嘗試通過ssh
隧道scp
時,我收到以下警告。 就我而言,我無法直接scp
到 foo,因為設備 foo 上的端口 1234 被轉發到專用網絡上的另一台機器 bar(而 bar 是給我提供到 192.168.1.23 的隧道的機器)。
$ # -f and -N don't matter and are only to run this example in one terminal
$ ssh -f -N -p 1234 userA@foo -L3333:192.168.1.23:22
$ scp -P 3333 foo.py ubuntu@localhost:
ubuntu@localhost's password:
stty: standard input: Inappropriate ioctl for device
foo.py 100% 1829 1.8KB/s 00:00
有誰知道為什么我可能會收到有關Inappropriate ioctl for device
警告?
當我在~/.bashrc
包含以下行時,我遇到了完全相同的問題:
stty -ixon
此行的目的是允許在bash 的反向搜索中使用Ctrl-s 。
此鏈接有解決方案(不可用)
'stty' 適用於交互式登錄會話的 ttys。 .kshrc 為所有會話執行,包括 stdin 不是 tty 的會話。 除了將其移動到您的 .profile 之外,解決方案是使其執行以交互式 shell 為條件。
有幾種方法可以檢查交互性 shell 。 以下解決了bash的問題:
[[ $- == *i* ]] && stty -ixon
最后我創建了一個空白的 .cshrc 文件(適用於 ubuntu 18.04)。 工作過
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.