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?

Fr3d

Could you paste the contents of your .bash_profile?

Socheat

my .bash_profile is the default:

# .bash_profile

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

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME

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
fi

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

export VISUAL="nano"
clear
uptime

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:

http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x264.html

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

Socheat

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
/X.X.X.X
SSH-1.99-OpenSSH_3.9p1
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?

Thanks!

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.

Socheat

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