Support for custom Port for Samba Servers? (Samba via SSH Tunnel)

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

Post Reply
seb-
Senior Member
Senior Member
Posts: 276
Joined: 2011-11-15, 06:14 UTC
Location: DE\BN - only part time TC user after switching to Linux ;)

Support for custom Port for Samba Servers? (Samba via SSH Tunnel)

Post by *seb- »

I just tried to access my Samba Server at home behind a NAT Router.
To do this, i created a Port Forwarding within VXConnectBot from Port 10445 to 192.168.2.10:445 (which is the server:port).

Within LAN Plugin i created a new share "localhost:10445" expecting this to connect through the Tunnel.

But from the connection status popup i assume that the ":port" is not even understood correctly, as in between it says "DNS Lookup 10445".

So...

is using a local portforwarding to access remote samba shares via SSH Tunnel somehow supported?
If not, is there any plan/will to do so in a future release, if yes, is it possible to give an estimation when :) ?

Please do not mention SFTP. I know this would probably work better for most of the cases, but not in this one...

Thanks + BR
Sebastian
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Support for custom Port for Samba Servers? (Samba via SSH Tunnel)

Post by *ghisler(Author) »

Unfortunately the plugin doesn't currently support custom ports. I don't know whether the used libraries support it - I will check it.
Author of Total Commander
https://www.ghisler.com
seb-
Senior Member
Senior Member
Posts: 276
Joined: 2011-11-15, 06:14 UTC
Location: DE\BN - only part time TC user after switching to Linux ;)

Re: Support for custom Port for Samba Servers? (Samba via SSH Tunnel)

Post by *seb- »

Thanks! I appreciate your efforts!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Support for custom Port for Samba Servers? (Samba via SSH Tunnel)

Post by *ghisler(Author) »

Sorry, my reply was incorrect: The plugin DOES support custom ports. However, since the colon ":" is used to separate domain and server, you need to put a colon also at the start if you don't specify a domain, e.g.:
:servername:portnumber
or
:IP-Address:portnumber

Please try it!
Author of Total Commander
https://www.ghisler.com
seb-
Senior Member
Senior Member
Posts: 276
Joined: 2011-11-15, 06:14 UTC
Location: DE\BN - only part time TC user after switching to Linux ;)

Re: Support for custom Port for Samba Servers? (Samba via SSH Tunnel)

Post by *seb- »

Hi ghisler, all,

TL;DR:
If you use port forwarding and Samba, make sure that you have stored the correct password in the connection settings. Otherwise TC internal HTTP server seems not to be able to create a connection for e.g. VLC Video Player and it fails...

-----------

Sorry it took me quite some time to revisit this topic. It has just recently re-emerged and i tried it with the latest version of the LAN Plugin.

My Setup is the following:
I use termux from f-droid.org store to setup ssh remote tunneling. Termux will bind a local port and forward it over SSH to my home network.
I can then - using your hint, which i actually found out first by using the "?" button ;-) - setup a LAN connection for "Server tunneled" which is

:localhost:10445/sambashare

(localhost port 10445 is termux listening and forwarding).

I can successfully login and browse the folders via a remote WLAN or even mobile network.

( Note: i was about to file a bug report here, that i can't get VLC to play videos of my SSH Tunenling setup, but i then figured out it was due to my own fault... )

When i'm at home, i can use the LAN Plugin and watch videos from my NAS with VLC Player for Android. I just have to open an MP4 and click "Play in Foreground".

I have found out, that TC / Lan Plugin will create some kind of HTTP server which it will supply to VLC to be able to play videos via Samba protocol.

I used tcpdump on my phone to see what is happening in the tunneling situation. I see that there is an HTTP Request on the port that TC is listening on, but the GET Request is answered with 404 file not found.
When i renamed the connection to not contain a space (because i thought that this is maybe a problem..) I realized that when I set up the connection, i typed the wrong password. TC had of course then failed to connect after typing the master password, but then prompted me to re-type the password. Then it worked and i could browse the Samba Share.

But it seems, when you do not setup the correct password to be saved, then the HTTP server will not be able to create a (new/second/?) connection in the background and of course VLC can not read the file.... And this while the browsing of the share in TC is working!

After i fixed the wrongly saved password, I can now enjoy MP4s from my NAS Server via a Samba session tunneled via SSH!

So maybe - if you have this extra time available - maybe you can somehow incorporate this finding into the plugin, It would be enough to point potential users to this by adapting the error message.

I hope my findings are somehow correct, but it works for me now... Maybe someone else can benefit from this...
Post Reply