pylibssh2 icon indicating copy to clipboard operation
pylibssh2 copied to clipboard

userauth_agent problem

Open tanyewei opened this issue 11 years ago • 2 comments

When i try to use userauth_agent method:

Error: Authentification by public key failed: No authorized key found in ssh-agent! (failed closing the agent socket) <Greenlet at 0xd37910: runcmd('115.238.73.226')> failed with Error

But: in the securecrt ssh forwarding is ok

Code:

    ret = self.session.userauth_agent('root')
    while ret == self.LIBSSH2_ERROR_EAGAIN:
        _wait_select(self.session, self.sock)
        ret = self.session.userauth_agent('root')

Thank you for your share!

tanyewei avatar May 21 '13 15:05 tanyewei

It's a bug ?

tanyewei avatar Jun 08 '13 02:06 tanyewei

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect(('ip', port)) sock.setblocking(1) session = libssh2.Session() session.setblocking(0) session.set_banner() session.startup(sock) session.userauth_agent('root') chan = session.open_session() chan.execute('ifconfig') stdout = chan.read_ex() session.close()

when set session.setblocking mode is 0

then: Authentification by public key failed: No authorized key found in ssh-agent!

tanyewei avatar Jun 08 '13 04:06 tanyewei