Q: Why is my connection unexpectedly dropped when using sftp, scp or SecureFX?
Answer
The most common cause of this problem is that your dotfiles contain commands which generate output. This extra output confuses the Secure FTP client and causes it to behave incorrectly. To verify that this is the cause of your problem, you can move or rename the following files:
- ~/.cshrc.mine
- ~/.environment
- ~/.bashrc.mine
- ~/.bash_environment
(You may not have all of the above files; simply rename the ones that exist.)
If that solves the problem, you will need to examine the contents of those files and change any lines that may generate output. A common problem is attaching lockers in your ~/.environment or ~/.bash_environment without using the "-q" option, which suppresses output.
Users of the tcsh shell can check for the $PROMPT variable to determine if the session is an interactive one (i.e. a login session) or a non-interactive one (i.e. an sftp session). Users of the bash shell can check for the $PS1 variable. If you're unsure which shell you're using, see the article How can I figure out what my default Athena shell is?