Errore "Received message too long" con sftp o winscp
Vedere questa soluzione:
Problem : Are you getting "Received message too long 1399157876" when trying to sftp to a host running openssh ? Everything appears to authenticate OK but it fails right after the login step ?
Solution : sftp tries to run a shell to setup some default variables right after you authenticate (roughly the same behaviour as ssh). The problem is that it isn't expecting a large text string in the return message & if it gets one it fails with the "Received message too long" error. A simple way to check what's causing this is to use "ssh site /bin/true" (suggested by Ben Lindstrom to the SecurityFocus mailing list) & if anything is returned that's the extraneous text sftp is complaining about. There was apparently a solution that worked prior to version 3.x of openssh that involved setting the sshd variable "AllowCshrcSourcingWithSubsystems" to yes. This variable doesn't work on my system (RH7.2 openssh 3.1p1). So the obvious solution was to remove the text, in our case "quota -s" to let people know how much hard drive space they're currently using. But we *liked* having that information available on login. So the kludge we came up with was to put an if statement into our system-wide tcshrc file that checked to see if a TERM was being set on login. sftp doesn't set a terminal but ssh does (and presumably so does telnet if you're still using it). The check looked like this :
if ($?TERM == 1) then
quota -s
endif
Oppure, semplicemente:
Se si ha in .profile . .bashrc un comando come ad esempio /etc/init.d/ntpd restart, redirezionare stdout e stderr a /dev/null, e tutto funzionerà a dovere