At one point, I wanted to connect from my MacBook Pro (using OS X Leopard 10.5.1) to our OS X server’s Samba shares from off campus. The only problem is that the server only allows SSH connections off campus. This is all you need, however, to create a tunnel and connect to the windows shares. To create the tunnel, do
sudo ssh user@servername -L localhost:139:servername:139
The next part involves mounting the share, which Leopard won’t let you do from the Finder (it gives the error message “This file server is running on your machine. Please access the volumes and files locally.” ) That’s ok, you can get around this by opening the terminal and typing the following commands:
- sudo mkdir /Volumes/sharename
- sudo mount_smbfs //username:password@localhost/sharename /Volumes/sharename
Note that in my case I wanted to have a subdirectory on the share mounted, so in place of command 2 above, I typed (all one line):
sudo mount_smbfs //username:password@localhost/sharename/subdir /Volumes/sharename
And it worked! I then used this share to do my backup using Time Machine. Time Machine will let you backup to network shares if you type the following at the terminal (all one line):
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1″