Kodi Community Forum

Full Version: SFTP addon (1.0.1.3) login issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
try if replacing the @ in your password with %40 helps.

found that info here: https://forums.vandyke.com/showthread.php?t=2457
Thanks for the suggestion. 
I'd already tried inserting the ascii hex in that format for each special character, collectively and individually for both the ! and the @.
The login still fails in each case (incorrect password), however, the correct username is now attempting login, rather than part of the password, which is shown in the FreeNAS logging.
(For these examples)
Code:
user=CORRECTUSERNAME
password=Pass!word@1234
Code:
Jan 7 13:14:42 freenas sshd[68416]: Failed password for CORRECTUSERNAME from x.x.x.x port 42240 ssh2
FWIW, I've also tested this scenario on a Windows10 box (Kodi 18B4, SFTP 1.01) with the same results, so it seems unrelated to platform.

So in summary:
Raw password used works initially, when Add network location... selected and SFTP credentials entered, hit ok, showing in "Browse for new share":
Code:
sftp|ssh://dns.address.net:port/mnt/volumexx/storage
...allowing selection and successful traversal of subdirectories to browse for a new share.  FreeNAS log confirms:
Code:
Jan 7 13:15:37 freenas sshd[68499]: Accepted password for CORRECTUSERNAME from x.x.x.x port 42240 ssh2
Next step, hit OK after selecting subdirectory path, where the path now shows:
Code:
sftp://[email protected]/mnt/volumexx/storage/media/movies
Which is rejected due to the incorrect user, illustrated by FreeNAS logs again.
Code:
Jan 7 13:36:01 freenas sshd[70357]: Invalid user 1234 from x.x.x.x port 42243
Jan 7 13:36:01 freenas sshd[70357]: input_userauth_request: invalid user 1234 [preauth]
After accepting the location, I get an unable to connect message just before setting content (obviously due to the user being incorrect), however, if I go back to the browse for new share and select the original:
Code:
sftp|ssh://dns.address.net:port/mnt/volumexx/storage
I can still select (and successfully traverse) with a successful login. 

Hopefully this helps find a resolution.  Cheers.
So I did find a way to get past the bad handling of '@' symbols in the SFTP password, using the %40.  Not perfect, but here's how to do it.
Using a previously defined network location like in my previous post:
Code:
sftp|ssh://dns.address.net:port/mnt/volumexx/storage
which can access this location without issues using:
Code:
user=CORRECTUSERNAME
password=Pass!word@1234
Then when adding for instance a movie file location, going into Add Video Source/Browse/selecting sftp location, then drill down to directory containing movies, click OK.
Back on the "Add video source" screen, you can clearly see the path is borked.  In this case it shows:
Code:
sftp://[email protected]:port/mnt/volumexx/storage...
If you clicked ok at this stage, it fails, however if you highlight the link and click into it, you will see:
Code:
sftp://CORRECTUSERNAME:Pass!word@[email protected]:port/mnt/volumexx/storage/media/movies
If you then change this to:
Code:
sftp://CORRECTUSERNAME:Pass!word%[email protected]:port/mnt/volumexx/storage/media/movies
The source will, after hitting ok, change to appear as:
Code:
sftp://dns.address.net:port/mnt/volumexx/storage/media/movies
and if ok is hit the connection now works and starts scanning in the library.

So in summary, adding the %40 to the network location password does not help, but does help when adding the source in this way.
Kind of odd, but at least there is a way around it.