ssh session and channel - SSH

This is a discussion on ssh session and channel - SSH ; Hi, what is difference of the two concepts 'ssh session' and 'ssh channel'? Does an ssh server allocate a session when it serves a client? According to the ssh specs, " All terminal sessions, forwarded connections, etc., are channels. Either ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: ssh session and channel

  1. ssh session and channel

    Hi,

    what is difference of the two concepts 'ssh session' and 'ssh
    channel'? Does an ssh server allocate a session when it serves a
    client? According to the ssh specs,

    " All terminal sessions, forwarded connections, etc., are channels.
    Either side may open a channel. Multiple channels are multiplexed
    into a single connection."

    Is the 'connection' mentioned here equivalent to the concept of
    'session'? Can a single ssh client process have all these different
    channels at the same time, like doing port forwarding and terminal
    session at the same time?

    Many thanks

    Timmy


  2. Re: ssh session and channel

    >>>>> "mdk" == mdk writes:

    mdk> Hi, what is difference of the two concepts 'ssh session' and 'ssh
    mdk> channel'? Does an ssh server allocate a session when it serves a
    mdk> client? According to the ssh specs,

    mdk> " All terminal sessions, forwarded connections, etc., are
    mdk> channels. Either side may open a channel. Multiple channels are
    mdk> multiplexed into a single connection."

    mdk> Is the 'connection' mentioned here equivalent to the concept of
    mdk> 'session'?

    Yes, although that fact is muddied by the use of the phrase "terminal
    session," which refers to a channel type.

    mdk> Can a single ssh client process have all these
    mdk> different channels at the same time, like doing port forwarding
    mdk> and terminal session at the same time?

    Yes. The SSH transport protocol (RFC 4253) creates the "connection," and
    the connection protocol (RFC 4254) multiplexes channels over the
    connection.

    mdk> Many thanks

    mdk> Timmy


    --
    Richard Silverman
    res@qoxp.net


  3. Re: ssh session and channel

    Hi Richard,

    Thanks for the reply. But I am still confused about the capability of
    multiplexing. Say you open a terminal to do port forwarding with
    command line, and open another terminal window to do remote terminal
    session. These are 2 processes, and they log in to the remote ssh
    server separately, and the server forks 2 child processes to handle
    their requests, each one using a single connection. As such, the two
    channels are not multiplexed. And it doesn't seem possible to
    multiplex these two channels.

    Timmy



  4. Re: ssh session and channel

    >>>>> "mdk" == mdk writes:

    mdk> Hi Richard, Thanks for the reply. But I am still confused about
    mdk> the capability of multiplexing. Say you open a terminal to do
    mdk> port forwarding with command line, and open another terminal
    mdk> window to do remote terminal session. These are 2 processes, and
    mdk> they log in to the remote ssh server separately, and the server
    mdk> forks 2 child processes to handle their requests, each one using
    mdk> a single connection. As such, the two channels are not
    mdk> multiplexed. And it doesn't seem possible to multiplex these two
    mdk> channels.

    Of course it isn't. The point is that a single SSH process may have
    multiple channels over a single connection. When you do this:

    ssh -L 1234:host1:5678 host2

    .... you get a terminal session over one channel. When the port forwarding
    is used, that creates another channel in the same connection.

    --
    Richard Silverman
    res@qoxp.net


+ Reply to Thread