Subject: Re: Re-authenticate

Re: Re-authenticate

From: Peter Stuge <peter_at_stuge.se>
Date: Wed, 20 Jun 2012 03:57:55 +0200

Casper Langemeijer wrote:
> re-use a SSH connection for several log ins (authentications)

This is correct. The SSH protocol only ever does authentication once
for every session, at the beginning. After the session is
authenticated then it is possible to open many channels.

libssh2 exposes both these things in the API.

> re-authenticate a second time.
>
> Can this be done with libssh2?

Can you explain in more detail what you want to do?

> Can this be done with the ssh protocol at all?

http://trac.libssh2.org/wiki/FAQ#WhatistheSSH-2protocol

After a session passes authentication there can be many channels.
Everything you use SSH for is a channel. The PHP plugin can choose
to reuse sessions transparently, in order to avoid creating new
sessions.

But under no circumstances can a single session be authenticated more
than once. That also does not make sense in protocol terms. Please do
look at the protocol RFCs. They are very very easy to read.

//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2012-06-20