Re: problem with sftp

From: Ben Kim (bkim_at_coe.tamu.edu)
Date: 08/31/05

  • Next message: Ben Kim: "RE: problem with sftp"
    Date: Tue, 30 Aug 2005 23:38:19 -0500 (CDT)
    To: "Pankaj Mandal (pmandal)" <pmandal@cisco.com>
    
    

    >I tried the solution, did not work though. Earlier I had also tried by
    >putting
    >/usr/local/libexec in the PATH before starting the sshd without any
    >success.

    This was not my case (since I don't have any command in my .profile or
    .cshrc), but FYI...

    http://info.nccs.gov/faq

    ==================================================

    File transfer server could not be started or it exited unexpectedly.
    Exit value 0 was returned. Most likely the sftp-server is not in the path
    of the user on the server-side.

    or

    Received message too long 1500476704

    These errors are usually caused by commands in a shell run-control file
    (.cshrc, .profile, .bashrc, etc.) that produce output to the terminal.
    This output interferes with the communication between the SSH daemon and
    the sftp-server subsystem. Examples of such commands might be date or
    echo. If you use the mail command to check for mail, it can cause the
    error, too.

    You can check to see if this is likely the problem. If you are unable to
    sftp to a machine, try to connect via ssh. If you are able to ssh, and you
    receive output to your terminal other than the standard login banner (for
    example “You have mail”), then you need to check your run control files
    for commands that might be producing the output.

    To solve this problem, you should place any commands that will produce
    output in a conditional statement that is only executed if the shell is
    interactive. For C shell users, a sample test to put in your .cshrc file
    would be:

    if ($?prompt)
      date
    endif

    The equivalent command for your .profile file (ksh/bash) would be:

    if [[ -n $PS1 ]]; then
     date
    fi
    ==============================
     
    Regards,

    Ben Kim
    Developer
    http://benix.tamu.edu


  • Next message: Ben Kim: "RE: problem with sftp"

    Relevant Pages

    • Checking for existence of command prior to execution
      ... alone in an interactive shell it works though. ... it will fail if I add ssh to the list of commands which is ... aliased by the tcsh that is calling the above script. ...
      (comp.os.linux.misc)
    • Re: Redirection issue
      ... 1- execute input commands from standard input, ... code to implement the redirection it does not work anymore. ... And it's not good shell behavior to echo commands anyway. ...
      (comp.lang.c)
    • Re: Redirection issue
      ... 1- execute input commands from standard input, ... the phrase "it does not work anymore" carries very little meaning. ... after compilation and execution of the shell with a simple command like ...
      (comp.lang.c)
    • vulnerabilities in scponly
      ... without allowing shell access. ... scponly makes no effort to verify the path to the scp or sftp-server ... arbitrary commands by simply uploading a file. ... However, if this is *NOT* the case, the user could execute arbitrary ...
      (Bugtraq)
    • Re: Redirection issue
      ... 1- execute input commands from standard input, ... "does not work" could be anything from not compiling, not executing, ... after compilation and execution of the shell with a simple command like ...
      (comp.lang.c)