These are the commands I used to mount my linux samba share on my macbook via SSH (over the internet).

In this example my remote server is on adomain.com, the username there is troyski, the password for the ssh account is “password” and the samba share previously created (and used at home internally) is called troys-share.

On the macbook

  • Connect to Internet
  • Start terminal and create a ssh tunnel with:-
sudo ssh -L 139:localhost:139 troyski@adomain.com

This will prompt you for your ssh password. This has to be done with sudo as privileged ports can only be forwarded by root.

  • Now start a new terminal session and check you can see shares are available using: –
smbclient -L localhost -U troyski

This will prompt you for your samba password, and should show a list of Sharenames (amongst other things).

  • Now make a directory locally to mount the samba share on: –
mkdir /Volumes/test
  • And mount the samba share with: –
mount_smbfs //troyski:password@localhost/troys-share /Volumes/test

The mounted volume can now be used as normal.