💾 Archived View for perso.pw › blog › articles › samba-tunnel.gmi captured on 2023-12-28 at 16:16:36. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-05-24)

➡️ Next capture (2024-03-21)

-=-=-=-=-=-=-

Mounting remote samba share through SSH tunnel

on Mastodon

If for some reason you need to access a Samba share outside of the

network, it is possible to access it through ssh and mount the share

on your local computer.

Using the ssh command as root is required because you will bind local

port 139 which is reserved for root:

# ssh -L 139:127.0.0.1:139 user@remote-server -N

Then you can mount the share as usual but using `localhost` instead of

`remote-server`.

Example of a mount element for `usmb`

<mount id="public" credentials="me">

<server>127.0.0.1</server>

<!--server>192.168.12.4</server-->

<share>public</share>

<mountpoint>/mnt/share</mountpoint>

<options>allow_other,uid=1000</options>

</mount>

As a reminder, `<!--tag>foobar</tag-->` is a XML comment.