non-interactive sftp and 'put' - SSH

This is a discussion on non-interactive sftp and 'put' - SSH ; I have the authentication set up and working correctly, just have a question on how to non-interactively upload files to the server using sftp. I can non-interactively download files using the following: sftp [[user@]host[:file [file]]] sftp [[user@]host[:dir[/]]] But there doesn't ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: non-interactive sftp and 'put'

  1. non-interactive sftp and 'put'


    I have the authentication set up and working correctly, just have a
    question on how to non-interactively upload files to the server using
    sftp. I can non-interactively download files using the following:
    sftp [[user@]host[:file [file]]]
    sftp [[user@]host[:dir[/]]]

    But there doesn't seem to be a way to put files on the server. I can
    create a batch file, but that is an ugly solution. I can also use scp,
    but we wanted to limit the user to their home directory on the ssh
    server. The Windows ssh server we are using does not restrict (other
    than file/directory permissions) the user to a certain directory when
    using scp, but it does restrict the user when using sftp.

    It looks like we may just have to lock down the entire directory
    structure on the ssh server so that the user isn't allowed to navigate
    anywhere in the filesystem (which will probably be done anyway).

    Any way to perform a non-interactive 'put' operation without using
    batch files?


    Thanks,
    Bo


  2. Re: non-interactive sftp and 'put'

    I am trying to do the same thing because scp isn't working properly
    from a linux box to a windows box. big surprise! Have you had any
    luck?

    Mitch
    mitch.saba AT uconn dot edu

    On Oct 15, 10:31 am, Ens8675...@aol.com wrote:
    > I have the authentication set up and working correctly, just have a
    > question on how to non-interactively upload files to the server using
    > sftp. I can non-interactively download files using the following:
    > sftp [[user@]host[:file [file]]]
    > sftp [[user@]host[:dir[/]]]
    >
    > But there doesn't seem to be a way to put files on the server. I can
    > create a batch file, but that is an ugly solution. I can also use scp,
    > but we wanted to limit the user to their home directory on the ssh
    > server. The Windows ssh server we are using does not restrict (other
    > than file/directory permissions) the user to a certain directory when
    > using scp, but it does restrict the user when using sftp.
    >
    > It looks like we may just have to lock down the entire directory
    > structure on the ssh server so that the user isn't allowed to navigate
    > anywhere in the filesystem (which will probably be done anyway).
    >
    > Any way to perform a non-interactive 'put' operation without using
    > batch files?
    >
    > Thanks,
    > Bo




  3. Re: non-interactive sftp and 'put'

    Ref: <1192458710.577219.230520@t8g2000prg.googlegroups.c om> de
    Ens8675301@aol.com
    >
    >I have the authentication set up and working correctly, just have a
    >question on how to non-interactively upload files to the server using
    >sftp. I can non-interactively download files using the following:
    > sftp [[user@]host[:file [file]]]
    > sftp [[user@]host[:dir[/]]]
    >


    Why not use this method:
    echo "put " | sftp [user@]host
    --
    Gilles "Cool Raoul" - http://coolraoul.cvp-net.com/

  4. Re: non-interactive sftp and 'put'

    On Oct 18, 1:43 pm, Gilles Pion wrote:
    > Ref: <1192458710.577219.230...@t8g2000prg.googlegroups.c om> de
    > Ens8675...@aol.com
    >
    >
    >
    > >I have the authentication set up and working correctly, just have a
    > >question on how to non-interactively upload files to the server using
    > >sftp. I can non-interactively download files using the following:
    > > sftp [[user@]host[:file [file]]]
    > > sftp [[user@]host[:dir[/]]]

    >
    > Why not use this method:
    > echo "put " | sftp [user@]host
    > --
    > Gilles "Cool Raoul" -http://coolraoul.cvp-net.com/



    That worked, thank you.


  5. Re: non-interactive sftp and 'put'

    Bo schrieb:
    > On Oct 18, 1:43 pm, Gilles Pion wrote:
    >> Ref: <1192458710.577219.230...@t8g2000prg.googlegroups.c om> de
    >> Ens8675...@aol.com
    >>
    >>
    >>
    >>> I have the authentication set up and working correctly, just have a
    >>> question on how to non-interactively upload files to the server using
    >>> sftp. I can non-interactively download files using the following:
    >>> sftp [[user@]host[:file [file]]]
    >>> sftp [[user@]host[:dir[/]]]

    >> Why not use this method:
    >> echo "put " | sftp [user@]host
    >> --
    >> Gilles "Cool Raoul" -http://coolraoul.cvp-net.com/

    >
    >
    > That worked, thank you.
    >

    why not
    scp user@host:remotefile localfile
    ?

  6. Re: non-interactive sftp and 'put'

    Ref: <47193572$0$16100$9b4e6d93@newsspool1.arcor-online.net> de Wolfgang

    >why not
    >scp user@host:remotefile localfile
    >?


    The thread initiator told us about issues using scp (the server is windows
    based)
    --
    Gilles "Cool Raoul" - http://coolraoul.cvp-net.com/

+ Reply to Thread