8000 Paramiko SSHException: not found in known_hosts · Issue #60 · Rahix/tbot · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Paramiko SSHException: not found in known_hosts #60

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

Open
drewwestrick opened this issue Sep 1, 2021 · 2 comments
Open

Paramiko SSHException: not found in known_hosts #60

drewwestrick opened this issue Sep 1, 2021 · 2 comments
Labels
bug A bug in tbot has-workaround This issue can temporarily be fixed by a hack/workaround

Comments

@drewwestrick
Copy link
drewwestrick commented Sep 1, 2021

I'm having some trouble connecting to a Raspberry Pi as a Lab config. I'm getting the follow error when I try to run the interactive_lab command. I can connect using the command ssh 172.16.100.119 without a password just fine. This connection is also in the known_hosts file.

paramiko.ssh_exception.SSHException: Server '172.16.100.119' not found in known_hosts

ssh_config

Host 172.16.100.119
  HostName 172.16.100.119
  User pi
  IdentityFile /home/drewwestrick/.ssh/rasp_pi

tc.py

import tbot
from tbot.machine import connector, linux

class AwesomeLab(
    connector.ParamikoConnector,
    linux.Bash,
    linux.Lab,
):
    name = "172.16.100.119"
    hostname = "172.16.100.119"
    username = "pi"

    @property
    def workdir(self):
        return linux.Workdir.athome(self, "tbot-workdir")


# tbot will check for `LAB`, don't forget to set it!
LAB = AwesomeLab
```c
@drewwestrick
Copy link
Author
drewwestrick commented Sep 1, 2021

I think I found one workaround for now. If I add a ignore_hostkey = True after the username property, it allows me to make a connection. It does appear that Paramiko is doing a load_system_host_keys which I believe is reading the ~/.ssh/known_hosts file. What I still don't understand is why it doesn't find my Server in that file even though a regular ssh command from the command line seems to be doing that just fine.

@Rahix
Copy link
Owner
Rahix commented Sep 3, 2021

Hi, thanks for the report. This looks odd indeed, I never had a problem like this... But it certainly looks like an upstream paramiko issue, I think.

To be quite honest, I would suggest that you switch to using the connector.SSHConnector instead. It uses the ssh command exactly like you would and thus sidesteps all of those odd issues from differences between OpenSSH and Paramiko...

For performance, I very much suggest also enabling the use_multiplexing = True option.

@Rahix Rahix added bug A bug in tbot has-workaround This issue can temporarily be fixed by a hack/workaround labels Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug in tbot has-workaround This issue can temporarily be fixed by a hack/workaround
Projects
None yet
Development

No branches or pull requests

2 participants
0