How to set up Kodi to access an NCP (Nextcloudpi) folder via SSH

Hello, I have Nextcloudpi installed in a board, and I have Kodi on my computer. A Movies folder in NCP contains my movies.
Locally, I can access via SMB without any issue, but it is impossible to do so when I am outside.

After asking how to access via webdav HTTPS with only one kind answer that doesn’t work (and in addition I realized that the URL contained the account ID and Password!), I finally want to go through SSH (safer).

Here are the key points of my configuration:

  • I only have port 443 open from the outside.
  • The data in NCP is stored in /media/my_data
  • Let’s call my user account USER (not admin user), the password PASS, and the IP address MY_PUBLIC_IP
  • The folder I want to access in USER account is Movies
  • There is already an SSH account on my NCP with an admin account/password. This allows me to access locally on port 22. I don’t know if this is important or not.

How do I access my movies from the outside?
I don’t understand why it’s so difficult, really I can’t do it.
Please, find below Kodi UI to setup SSH. Thank you for your help.

Hello, any help please ?
Thank you !

It is probably a better idea, to set up a VPN to you local network.
You might want to read up on that kind of solution.

@prog-amateur
I would suggest you use webdav to connect kodi to your NC instance.

server address will look like: https://sub.domain.tld/remote.php/webdav/path/to/media
with a user/password generated for kodi in NC-admin>security

I am pretty happy with samba and nfs. They are both supported by NCP

Thank you, I will try to learn how to do that.

@OliverV : thank you, I have tried webdav without any success, I know it can work but I could not succeed to do it. I will try again… as soon as possible : my Rock64 has crashed today, this issue becomes priority.

@nachoparker : thank you for your feedback, I can connect with samba but locally only. What I want is to connect securely from outside my home. As I have said to @OliverV, my Rock64 has just crashed a few hours ago due to power outage (and yet I have the official Pine64 quality power supply for the Rock64).
I’m sad, I can’t access locally or from the public IP address. The LEDs work, the LEDs of the RJ45 cable flash, and the external hard disk drive also works. Do you think I need to reinstall Nextcloudpi on the eMMC or is it an easy failure to fix?
Thank you very much!

So I have reinstalled NextcloudPi on Rock64 as it was not possible to recover it.

So I have succeed to connect through webdav (HTTPS), thank you @OliverV . However, I don’t want to close this issue as if you click on “edit file location” in Kodi, you can see in the URL your ID and PASSWORD as a clear text. This is not acceptable for security reasons.

So please, let me insist : how can I connect through SSH ?

Thank you very much for your help.

Well I notice that nobody answers so I want to ask my question differently and hope for a return:

NextcloudPi allows you to connect in SSH to the root account (local, port 22).
I want to log in as an SSH on a non-root user account from outside my home.
So I could eventually enter this information into Kodi as a non-root user.

For that, I read on the web that it was enough to modify the configuration file:

nano /etc/ssh/ssh/sshd_config

Then add or modify the line if it already exists:

AllowUsers user1 user2

Could you confirm that for me, please?
Also which port shall I use from outside ?

I think that if we could find a solution, it could make it a useful tutorial for others. Thank you.

Wouldnt you agree that support for Kodi would get more response on Kodi dedicated forum?

I maintain that using ssh for this, is a bad idea, that is probably why you are not getting answers,

If you are concerned about password being saved in clear, use a rsa pub key set.

In sshd_config AllowUsers is optional, more important is to set

AllowRootLogin no

And once the rsa key is installed and enabled in sshd_config, disable password logins alltogether

I usually use any port above 8000, and just forward that external port to internal ip:22

That said: your non-root account user will still not be able to read the NC files, they are owned by the webserver.

Better use earlier mentioned options,
or maybe, on the Kodi pc, use dav2fs and fstab (on Linux) to mount the media folder using webdav and share that (virtually) local folder with Kodi.