Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

userauth_agent problem #19

Open
tanyewei opened this issue May 21, 2013 · 2 comments
Open

userauth_agent problem #19

tanyewei opened this issue May 21, 2013 · 2 comments

Comments

@tanyewei
Copy link

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
Copy link
Author

tanyewei commented Jun 8, 2013

It's a bug ?

@tanyewei
Copy link
Author

tanyewei commented Jun 8, 2013

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant