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

Host is not known 'Invalid argument in ssh_options_set' #23

Open
jobhh opened this issue Feb 8, 2019 · 6 comments
Open

Host is not known 'Invalid argument in ssh_options_set' #23

jobhh opened this issue Feb 8, 2019 · 6 comments

Comments

@jobhh
Copy link

jobhh commented Feb 8, 2019

I might have encountered another bug. I also "fixed it", so if anyone else encountered this error message in your kodi.log, look below.

Kodi 17 with SFTP was working without issues on Android TV, on a Nvidia Shield with its latest software. I updated to Kodi 18 and ran into the following issue. The Kodi GUI doesn't give any information on why the SFTP connection doesn't work, or that the connection failed in the first place.

20:58:38.491 T:30367   ERROR: AddOnLog: SFTP support: SFTPSession: The host key for this server was not found but an other type of key exists. An attacker might change the default server key to confuse your client into thinking the key does not exist
20:58:38.491 T:30367   ERROR: AddOnLog: SFTP support: SFTPSession: Host is not known 'Invalid argument in ssh_options_set'
20:58:38.506 T:30377  NOTICE: VideoInfoScanner: Starting scan ..
20:58:38.506 T:30377 WARNING: Process directory 'sftp://USERNAME:PASSWORD@DOMAIN:PORT/Media/Movies/' does not exist - skipping scan.
20:58:38.507 T:30377 WARNING: Process directory 'sftp://USERNAME:PASSWORD@DOMAIN:PORT/Media/Series/' does not exist - skipping scan.
20:58:38.507 T:30377 WARNING: Process directory 'sftp://USERNAME:PASSWORD@DOMAIN:PORT/Media/Series/_SUBFOLDER_/' does not exist - skipping scan.
20:58:38.507 T:30377 WARNING: Process directory 'sftp://USERNAME:PASSWORD@DOMAIN:PORT/Media/Series/_SUBFOLDER_/' does not exist - skipping scan.
20:58:38.507 T:30377 WARNING: Process directory 'sftp://USERNAME:PASSWORD@DOMAIN:PORT/Media/Series/_SUBFOLDER_/' does not exist - skipping scan.
20:58:38.508 T:30377 WARNING: Process directory 'sftp://USERNAME:PASSWORD@DOMAIN:PORT/Media/Series/_SUBFOLDER_/' does not exist - skipping scan.
20:58:38.508 T:30377 WARNING: Process directory 'sftp://USERNAME:PASSWORD@DOMAIN:PORT/Media/Series/_SUBFOLDER_/' does not exist - skipping scan.
20:58:38.508 T:30377 WARNING: Process directory 'sftp://USERNAME:PASSWORD@DOMAIN:PORT/Media/Series/_SUBFOLDER_/' does not exist - skipping scan.
20:58:38.520 T:30377  NOTICE: VideoInfoScanner: Finished scan. Scanning for video info took 00:00

The known_hosts looked like this:

[DOMAIN]:PORT ecdsa-sha2-nistp256 STRINGOF140CHARACTERS

I removed it and the newly created known_hosts, and the known_hosts that has been on my laptop for months, looks like this:

[DOMAIN]:PORT ssh-ed25519 STRINGOF68CHARACTERS

Possible explanations:

  1. ECDSA support was removed from Kodi 18. I wouldn't mind, ed25519 is better.
  2. Synology stopped ECDSA authentication support around the same time I updated Kodi.
  3. Kodi changed the known_hosts file during the update to Kodi 18, which I find unlikely.

Anyways :) Fix: Remove the known_hosts file and try the SFTP connection in Kodi again. On Android it is at Android\data\org.xbmc.kodi\files.ssh\known_hosts.

@manuel-koch
Copy link

manuel-koch commented Feb 9, 2019

I have the same problem - but on Mac OSX Mojave.

I already deleted my ~/.ssh/known_hosts but Kodi keeps complaining when trying to access my media files via ftp/ssh ( replaced particular host/user in log with MY_xxx ) :

18:20:44.463 T:123145328902144    INFO: AddOnLog: SFTP support: SFTPSession: Creating new session on host 'MY_REMOTE_HOST:22' with user 'MY_REMOTE_USER'
18:20:44.597 T:4611966400   DEBUG: ------ Window Deinit (DialogConfirm.xml) ------
18:20:44.704 T:123145328902144   ERROR: AddOnLog: SFTP support: SFTPSession: The host key for this server was not found but an other type of key exists. An attacker might change the default server key to confuse your client into thinking the key does not exist
18:20:44.704 T:123145328902144   ERROR: AddOnLog: SFTP support: SFTPSession: Host is not known 'Invalid argument in ssh_options_set'
18:20:44.704 T:123145328902144 WARNING: Process directory 'sftp|ssh://USERNAME:PASSWORD@MY_REMOTE_HOST:22/video/' does not exist - skipping scan.

Is there any other known_hosts that Kodi refers to ?

I can access the remote host via sftp and ssh ( and the given "video" directory ) on console when using the given user though.
And the host was added to my known_hosts after accessing host via sftp/ssh on my console.

What else can be done to fix this problem ?

My known_hosts contains this entry for the host:

MY_REMOTE_HOST ecdsa-sha2-nistp256 STRINGOF140CHARACTERS

@manuel-koch
Copy link

I created a new ssh-key using ssh-keygen -t ed25519 -f ~/.ssh/my_remote_host_ed25519 -C "my_remote_user@my_remote_host" and added the public key to authorized_keys of my remote user on remote host.
I deleted my local known_hostsand connect via ssh/sftp using the new ssh-key and my known_hosts now still contains

MY_REMOTE_HOST ecdsa-sha2-nistp256 STRINGOF140CHARACTERS

Looks like the ssh-key of my remote Synology Diskstation uses an old/unsupported ssh-key !?
I have no clue how to upgrade/change the ssh-key on the remote Synology Diskstation ??

@manuel-koch
Copy link

I managed to change the used ssh-key in my synology diskstation by editing /etc/ssh/sshd_config and uncommenting the setting HostKey /etc/ssh/ssh_host_ed25519_key to force it to use ED25519 host key instead of the default RSA/DSA.

After cleaning my local known_hosts and manually login via ssh with my remote user on the remote host the known_hosts now contains the entry with the ED25519 reference.

And Kodi can read my movies on the remote host again :-)

Thanks for creating Kodi and this SSH/SFTP plugin !!

@tpwrm
Copy link

tpwrm commented Apr 27, 2019

This worked for me.
Thanks

@odoral
Copy link

odoral commented May 2, 2019

Thanks @jobhh.

I had same issue and fixed it removing the known_hosts file.

@SmokeyBR
Copy link

SmokeyBR commented Oct 18, 2019

right if anyone running kodi on windows have this problem, you can find known_hosts file under:
C:\Users\USERNAME\.ssh

mine happened because server running ubuntu was reinstalled and host key was changed, which is normal behavior.

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

5 participants