Re: ssh version 2 "subsystems"

<pwu@xxxxxxxxxxxxx> wrote:
ssh2 supports "subsystems" which apparently means that you can run a
process on the remote server and interact with that process wihtout

Yes. Though note that this is no different in effect from just
running a process using the normal method: doing an SSH2 subsystem
request for "sftp" is identical in semantics to doing an SSH2 "exec"
request for "/usr/lib/sftp-server", except that in the former case
you don't have to worry about whether sftp-server is kept in
/usr/lib, /usr/local/lib, /opt/ssh/lib or DKB200:[SSH.UTILS].

Can someone tell me:
1) What subsystems are supported (Linux and Solaris environment)?

Depends on your installation. Look at /etc/ssh/sshd_config.

2) How do I use this feature?

Typically the program invoked by a subsystem is a server designed to
be talked to be a dedicated client program. You wouldn't generally
invoke the "sftp" subsystem by hand, for example: instead you'd run
an sftp client (such as the one provided by OpenSSH), which would
take care of running ssh with the appropriate -s option and
interpret the resulting communications.

I know for instance there is a sftp "subsystem" under openssh and I
have tried:
ssh remote -s sftp
It does not prompt with anything as expected but when I:
put <file>
I expect <file> to be transfered to the remote side but nothing

Indeed. The program to which you should be typing commands at that
level is not the remote sftp subsystem: it's the local sftp client.
The subsystem is expecting to receive a stream of carefully
formatted SFTP data packets in accordance with the SFTP
specification, which will tell it to do things along the lines of
'open this file for output', 'write the following 4096 bytes to it
starting at offset 12345', 'close the file', 'retrieve a list of
file names in this directory' and so on.

You certainly shouldn't expect to transfer a file to the server by
typing the name of the file on the client side into a process
running on the server side - how would such a process make use of
that file name, without direct access to the client's filesystem?

So instead, you run your local sftp client, which _can_ access your
local filesystem, and will construct the appropriate stream of SFTP
request packets to implement your 'put' commands.
Simon Tatham "I'm cross. I'm going to have a tantrum.
<anakin@xxxxxxxxx> <pause> How do I start?" - my uncle

Relevant Pages

  • SFTP From Linux to Windows
    ... I'm doing development work on a remote Windows server, ... Shell Server 3.x and I'm using SFTP to transfer files. ... I have two main clients that support SFTP that I want to use. ...
  • script to SFTP without NET::SFTP module
    ... Does any one have a simple script to retrieve a file from a remote ... server using SFTP? ...
  • Re: SPAM sudden increase
    ... > Dude was on a tech call with f-secure and the tech asked, "So, ... dude is trying to FTP to their server using WSFTP. ... but I think he is talking about sftp protocol - FTP via ...
  • using java with sftp
    ... JCraft JSch package to SFTP files. ... //First Create a JSch session ... System.err.println("Unable to connect to FTP server. ...
  • Re: using java with sftp
    ... JCraft JSch package to SFTP files. ... //First Create a JSch session ... System.err.println("Unable to connect to FTP server. ...