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

SSH fails on second time #1925

Open
synergiator opened this issue Jan 10, 2019 · 0 comments
Open

SSH fails on second time #1925

synergiator opened this issue Jan 10, 2019 · 0 comments

Comments

@synergiator
Copy link

synergiator commented Jan 10, 2019

How is it possible that if you create two ssh connections one after another, the second fails? login works otherwise if tested manually.

def do_ssh_login(self, ip, password, port = 22):
        host = "cloud@"+ip+":"+ str(port)
        print("try login to host: %s with password %s" % (host, password))
        try:
            Connection(host=host )
            c = Connection(host = host, connect_kwargs={"password": password})
            result = c.run('uname -a')
            c.close()
            print(result)

First time to one host this function works; second time to another host there is this error:

Error opening None: Unable to connect to port 22 on <IP>

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