German (my coworker and friend) posted something a while ago which I am now finding pretty useful: http://eichberger.de/2006/01/ssh-tunnel-smb-for-mac-os-x.html
Note that this post is oriented toward those with macs, but the same should work on other *nix systems with a few minor modifications.
Why do I need this? Well, I’m still on the campus network, but currently in another building, which precludes me from being able to mount the SMB share from the file server… something about the network that neither do I care to understand at this point, nor do I need to. There’s an easy work-around:
You need to forward ports to another server/workstation that has access to the samba share. Once you have the tunneling up and running you can act as if you were sitting at that other computer.
From the terminal: sudo ssh -L 139:host-ip:139 uname@server.ext
From the “Connect to server” dialog in the finder: smb://localhost/name-of-your-share
Put it to use: an example
Say you have ssh access to a computer, mydomain.com, which also happens to host the Samba share.
Open the terminal and type: sudo ssh -L 139:mydomain.com:139 username@mydomain.com
enter your password on the computer you’re sitting at now
enter the password for the server you’re tunneling to
…ok Now you should be properly tunneled to mydomain.com
Open the “Connect to Server” dialog (Apple-K, or from the Finder: Go->Connect to Server…). Since the samba share is hosted on mydomain.com, you don’t need to do too much from here. For the sake of this example, we’ll call the mount “files.”
Enter smb://localhost/files
You’ll be asked for your username and password on the server mydomain.com
There you go… the samba share will mount on your desktop and you’re done!