When you get an error 103 establishing an SFTP
Posted by jpluimers on 2025/12/10
A while ago I got an error 103 using both Beyond Compare. That did not whos the connection log or error reason, but WinSCP did: it mentioned unexpected output during the logon.
I got reminded that I had already solved this error before via [Wayback/Archive] SSH login works but SFTP login doesn’t – Server Fault (thanks [Wayback/Archive] qreon and [Wayback/Archive] Paulus):
Q
when I log into my VPS with putty, everything works fine. But when connecting with FileZilla through SFTP, I always get an error :
Authentication failed, cannot establish connection to the server(roughly translated).
I am using the right settings in FileZilla because I only got this error 3 days ago and it used to work fine beforeA
This can be caused by echo or other commands that write to the console during logon. For example I was trying to set environment variables for a complex build process, and had added echos into all my .profile files, including into.bashrcAll the sftp clients I tried: filezilla, Beyond Compare suddenly stopped working, but did not give helpful error messages. Beyond Compare said:Connection failed: Failed to establish SFTP connection (error code is 103) Failed to establish SFTP connection (error code is 103)Finally corporate IT asked me to try WinSCP which gave a useful error message:Received too large (1701737573 B) SFTP packet. Max supported packet size is 1024000 B. The error is typically caused by message printed from startup script (like .profile). The message may start with "ente". Cannot initialize SFTP protocol. Is the host running a SFTP server?This gave me the clue I needed
So the solution was the same as in Filezilla: figuring out the cause of “Connection timed out after 20 seconds of inactivity”:
This solved my problem
This is what my
/etc/bash.bashrc.locallooked like:# /etc/bash.bashrc.local for SUSE Linux # # PLEASE DO NOT CHANGE /etc/bash.bashrc There are chances that your changes # will be lost during system upgrades. Instead use /etc/bash.bashrc.local # for bash or /etc/ksh.kshrc.local for ksh or /etc/zsh.zshrc.local for the # zsh or /etc/ash.ashrc.local for the plain ash bourne shell for your local # settings, favourite global aliases, VISUAL and EDITOR variables, etc ... . /etc/bash.aliases/_load-aliases.sh # # End of /etc/bash.bashrc.local #This is what it looks like now:
# /etc/bash.bashrc.local for SUSE Linux # # PLEASE DO NOT CHANGE /etc/bash.bashrc There are chances that your changes # will be lost during system upgrades. Instead use /etc/bash.bashrc.local # for bash or /etc/ksh.kshrc.local for ksh or /etc/zsh.zshrc.local for the # zsh or /etc/ash.ashrc.local for the plain ash bourne shell for your local # settings, favourite global aliases, VISUAL and EDITOR variables, etc ... if [ "$SSH_TTY" ] then source /etc/bash.aliases/_load-aliases.sh fi # # End of /etc/bash.bashrc.local #
Since this solution was not mentioned on [Wayback/Archive] SFTP error code 103 – Scooter Forums, I added it to [Wayback/Archive] SFTP error code 103 – Scooter Forums – page 2.
Query
[Wayback/Archive] sftp error 103 – Google Search
–jeroen






Leave a comment