Getting stty: standard input: Inappropriate ioctl for device when using scp through an ssh tunnel Getting stty: standard input: Inappropriate ioctl for device when using scp through an ssh tunnel linux linux

Getting stty: standard input: Inappropriate ioctl for device when using scp through an ssh tunnel


I got the exact same problem when I included the following line on my ~/.bashrc:

stty -ixon

The purpose of this line was to allow the use of Ctrl-s in reverse search of bash.

This link has a solution (not available)

Web Archive version of the above link

'stty' applies to ttys, which you have for interactive login sessions..kshrc is executed for all sessions, including ones where stdin isn'ta tty. The solution, other than moving it to your .profile, is tomake execution conditional on it being an interactive shell.

There are several ways to check for interecative shell. The following solves the problem for bash:

[[ $- == *i* ]] && stty -ixon


Got the same issue while executing the script remotely. After many tries didn't get any luck to solve this error. Then got an article to run a shell script through ssh. This was an issue related to ssh, not any other command. ssh -t "command" -t will allocate a pseudo TTY to the ssh and this error won't come.


at the end i created a blank .cshrc file ( for ubuntu 18.04). worked