SCP/SFTP Problem

I keep getting this while trying to use WinSCP to login to my new server:

Received too large (540160058 B) SFTP packet. Max supported packet size is 102400 B.

The error is typically caused by message printed from startup script (like .profile). The message may start with " 20:".

The home directory of the user I’m trying to login as contains:

drwx------   5 fred fred    4096 Sep 12 20:45 .
drwxr-xr-x   4 root root    4096 Aug 26 03:07 ..
-rw-------   1 fred fred    1901 Sep 12 20:25 .bash_history
-rw-r--r--   1 fred fred     304 Aug 26 03:07 .bash_logout
-rw-r--r--   1 fred fred     191 Aug 26 03:07 .bash_profile
-rw-r--r--   1 fred fred     317 Aug 27 13:07 .bashrc
-rw-r--r--   1 fred fred     383 Aug 26 03:07 .emacs
drwx------   2 fred fred    4096 Sep 12 20:45 .ssh
drwx------   8 fred fred    4096 Sep 12 20:25 unreal
-rw-rw-r--   1 fred fred 2546977 Jul 21 16:22 Unreal3.2.5.tar.gz
drwx------  12 fred fred    4096 Aug 27 13:36 unrealircd

I have customized the colors and format of the bash prompt; could this be causing it? Or any other ideas?


Could you paste the contents of your .bash_profile?


my .bash_profile is the default:

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc

# User specific environment and startup programs


export PATH

my .bashrc file:

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc

PS1='\[\033[01;32m\]\u\[\033[01;31m\]@\[\033[01;32m\]\h\[\033[01;31m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

export VISUAL="nano"

My guess would be the call to “uptime” in your .bashrc is what’s causing the problem. I would use the PROMPT_COMMAND variable instead:

It should achieve the same effect for interactive shell sessions, but won’t print out text on non-interactive sessions.


SFTP used to work on both my interworx servers and now they dont. Im wondering if it was due to interworx upgrade?

Here is the error:
Wed Sep 13 07:24:36 MDT 2006
SSH Error: The SFTP Subsystem could not be initialized

X.X.X.X is the ip of the server.

centos 4 and latest version of interworx.

ANy ideas?


Hi John,

I just responded to your ticket you had opened with us. For those who are interested, the problem was that /etc/ssh/sshd_config had the wrong path to sftp-server. It originally had /usr/libexec/sftp-server, but the correct path was /usr/libexec/openssh/sftp-server.


Moving the clear and uptime commands from .bashrc to .bash_profile did it for me Socheat - Thanks :slight_smile: