How is a sftp packet format - SSH

This is a discussion on How is a sftp packet format - SSH ; Hi, I am trying to write sftp protocol . I have a ssh v2 implementation which I am using. I want to know the packet format for SSH_FXP_INIT from the client to the server. Is this packet embedded in SSH2_MSG_CHANNEL_DATA. ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: How is a sftp packet format

  1. How is a sftp packet format

    Hi,
    I am trying to write sftp protocol . I have a ssh v2 implementation
    which I am using. I want to know the packet format for SSH_FXP_INIT
    from the client to the server. Is this packet embedded in
    SSH2_MSG_CHANNEL_DATA. Please let me know if the packet format below is
    correct.

    byte[0]= SSH2_MSG_CHANNEL_DATA
    byte[1-4] = remote_channel_id;
    byte[5-8] = 5; /*length field */
    byte[9] = SSH2_FXP_INIT
    byte[10-13] = sftp_version /* may be 3 which is what I am using */

    If I am running an open sftp-server as soon as this packet is arrived
    at the server the server is closing the channel. Can anyone let me know
    what is the packet format for sftp.
    Thanks,
    I. Kiran


  2. Re: How is a sftp packet format

    >>>>> "ikiran" == ikiran writes:

    ikiran> Hi, I am trying to write sftp protocol . I have a ssh v2
    ikiran> implementation which I am using. I want to know the packet
    ikiran> format for SSH_FXP_INIT from the client to the server. Is this
    ikiran> packet embedded in SSH2_MSG_CHANNEL_DATA. Please let me know
    ikiran> if the packet format below is correct.

    ikiran> byte[0]= SSH2_MSG_CHANNEL_DATA byte[1-4] = remote_channel_id;
    ikiran> byte[5-8] = 5; /*length field */ byte[9] = SSH2_FXP_INIT
    ikiran> byte[10-13] = sftp_version /* may be 3 which is what I am
    ikiran> using */

    ikiran> If I am running an open sftp-server as soon as this packet is
    ikiran> arrived at the server the server is closing the channel. Can
    ikiran> anyone let me know what is the packet format for sftp.
    ikiran> Thanks, I. Kiran

    http://www.snailbook.com/docs/sftp.txt

    --
    Richard Silverman
    res@qoxp.net


  3. Re: How is a sftp packet format

    Thanks Richard for the reply. I am referring to version 3 described in
    http://www.openssh.org/txt/draft-iet...ilexfer-02.txt
    Now I am encoding the packet using byte[0-3] = 5; /*length field */
    byte[4] = SSH2_FXP_INIT
    byte[5-8] = sftp_version /* may be 3 which is what I am using */ . I am
    encrypting this packet and sending this packet out. I am not running a
    seperate ssh client process. I am running the ssh client functionality
    in sftp process. Can you please let me know if any message needs to be
    sent between requesting sftp subsystem and sending the version string
    and is the version string format correct.

    Thanks,
    Kiran


  4. Re: How is a sftp packet format

    Hi Kiran,

    I am having the same problem with sending a SFTP packet after creating a 'sftp' subsystem on SSH. When I send SSH_FXP_INIT packet, I am getting CHANNEL_CLOSE/EOF packet. Did you find any solution to this?

    Thanks,
    Adarsha

+ Reply to Thread