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

Another connection issue #75

Open
Dmarc opened this issue Aug 23, 2022 · 10 comments
Open

Another connection issue #75

Dmarc opened this issue Aug 23, 2022 · 10 comments

Comments

@Dmarc
Copy link

Dmarc commented Aug 23, 2022

I fail using remouse, because (I guess) of some connection issue. The instruction remouse --address remarkable --debug yields:

rDebugging enabled... Connecting to input 'remarkable'

then, after a couple of minutes:

Traceback (most recent call last): File "/usr/bin/remouse", line 8, in <module> sys.exit(main())

File "/home/marc/.local/lib/python3.10/site-packages/remarkable_mouse/remarkable_mouse.py", line 138, in main rm_inputs = open_rm_inputs(

File "/home/marc/.local/lib/python3.10/site-packages/remarkable_mouse/remarkable_mouse.py", line 73, in open_rm_inputs client.connect(

File "/home/marc/.local/lib/python3.10/site-packages/paramiko/client.py", line 349, in connect retry_on_signal(lambda: sock.connect(addr))

File "/home/marc/.local/lib/python3.10/site-packages/paramiko/util.py", line 283, in retry_on_signal return function()

File "/home/marc/.local/lib/python3.10/site-packages/paramiko/client.py", line 349, in <lambda> retry_on_signal(lambda: sock.connect(addr))

TimeoutError: [Errno 110] Connection timed out

The remarkable config is:
Host remarkable
Hostname 10.11.99.1
User root
Port 22
IdentityFile ~/.ssh/remarkable2
PubkeyAcceptedKeyTypes=+ssh-rsa
HostKeyAlgorithms=+ssh-rsa

I checked that ssh remarkable works just fine, yet.

@Evidlo
Copy link
Owner

Evidlo commented Aug 23, 2022

Does it work if you leave out --address? Can you ssh into 10.11.99.1?

@Dmarc
Copy link
Author

Dmarc commented Aug 23, 2022

No, it does not work. When doing ssh into 10.11.99.1, I have the message Unable to negotiate with 10.11.99.1 port 22: no matching host key type found. Their offer: ssh-rsa. This is because with openSSH 8.8 and later, ssh-rsa keys are disabled by default, as explained here. This is why I added the two lines
PubkeyAcceptedKeyTypes +ssh-rsa
HostKeyAlgorithms +ssh-rsa
into the SSH config file.

@Evidlo
Copy link
Owner

Evidlo commented Aug 23, 2022

That's a bit weird, as the exception from Paramiko is about timing out, whereas the issue in openssh-client is that that RSA isn't supported anymore.

@Dmarc
Copy link
Author

Dmarc commented Aug 23, 2022

Yep, since ssh remarkable works great (with remarkable defined in the SSH config file as shown above), I was expecting that remouse --address remarkable would have worked as well...

@Dmarc
Copy link
Author

Dmarc commented Aug 24, 2022

I forgot to mention I have a Remarkable 2.

@Evidlo
Copy link
Owner

Evidlo commented Aug 24, 2022

Have you remouse with 10.11.99.1, so that it doesn't use your ssh config?

@Dmarc
Copy link
Author

Dmarc commented Aug 24, 2022

Here is the result of remouse --address 10.11.99.1:

/home/marc/.local/lib/python3.10/site-packages/paramiko/transport.py:236: CryptographyDeprecationWarning: Blowfish has been deprecated
  "class": algorithms.Blowfish,
Exception (client): key cannot be used for signing
Traceback (most recent call last):
  File "/home/marc/.local/lib/python3.10/site-packages/paramiko/transport.py", line 2163, in run
    handler(self.auth_handler, m)
  File "/home/marc/.local/lib/python3.10/site-packages/paramiko/auth_handler.py", line 375, in _parse_service_accept
    sig = self.private_key.sign_ssh_data(blob, algorithm)
  File "/home/marc/.local/lib/python3.10/site-packages/paramiko/agent.py", line 434, in sign_ssh_data
    raise SSHException("key cannot be used for signing")
paramiko.ssh_exception.SSHException: key cannot be used for signing

Traceback (most recent call last):
  File "/usr/bin/remouse", line 8, in <module>
    sys.exit(main())
  File "/home/marc/.local/lib/python3.10/site-packages/remarkable_mouse/remarkable_mouse.py", line 138, in main
    rm_inputs = open_rm_inputs(
  File "/home/marc/.local/lib/python3.10/site-packages/remarkable_mouse/remarkable_mouse.py", line 73, in open_rm_inputs
    client.connect(
  File "/home/marc/.local/lib/python3.10/site-packages/paramiko/client.py", line 435, in connect
    self._auth(
  File "/home/marc/.local/lib/python3.10/site-packages/paramiko/client.py", line 766, in _auth
    raise saved_exception
  File "/home/marc/.local/lib/python3.10/site-packages/paramiko/client.py", line 702, in _auth
    self._transport.auth_publickey(username, key)
  File "/home/marc/.local/lib/python3.10/site-packages/paramiko/transport.py", line 1624, in auth_publickey
    raise SSHException("No existing session")
paramiko.ssh_exception.SSHException: No existing session

@Evidlo
Copy link
Owner

Evidlo commented Aug 24, 2022

Can you try with the --password option?

I think it doesn't like your default ssh key. You might also try generating an RSA ssh key and use the --key option.

@Dmarc
Copy link
Author

Dmarc commented Aug 25, 2022

Adding the --password option yields the exact same error message as above.
I think these two lines generate an RSA ssh key, as you suggested:

ssh-keygen -m PEM -t rsa -f ~/.ssh/remarkable -N ''
ssh-copy-id -i ~/.ssh/remarkable.pub [email protected]

Though for having it working properly (i.e., without paramiko exception), I had to replace [email protected] with remarkable. But then remouse --address 10.11.99.1 --key ~/.ssh/remarkable still returns the same error message.

@Evidlo
Copy link
Owner

Evidlo commented Oct 14, 2022

Is this still an issue? I'm not sure why 10.11.99.1 isn't working for you. What does host remarkable return?

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

2 participants