I got this message when I copy file using scp to CentOS server "stdin: is not a tty"
. What it means and how I make it go away? The transfer is ok.
1 Answer
This is likely because the /etc/bashrc
script is trying to run stty, and indeed, stdin is not a tty.
You should make sure your login script exits early when it is being used in a non-interactive manner.
In csh syntax this is usually done by adding something like this to your login script (prior to commands like stty
that are only useful for interactive sessions):
if ( ! $?USER || "$prompt" == "" || ! $?term ) then
exit
endif
The same thing can be accomplished in bash by adding the following at the beginning of .bashrc
:
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac