OS X: Difference between revisions

From Han Wiki
Jump to navigation Jump to search
→‎Tunneling SMB mount through SSH: add optional parameters
Line 10: Line 10:
</source>
</source>


The above actually logs you in while forwarding the port. Optionally, you can add these parameters to suppress the log-in and only forward the port via SSH.
The above actually logs you in while forwarding the port. Optionally, you can add these parameters to suppress the log-in and only forward the port via SSH in the background. Make sure NOT to close the console.


<source lang="bash">
<source lang="bash">

Revision as of 11:32, 14 June 2016

Tunneling SMB mount through SSH

  • Last tested on OS X El Capitan 10.11.5
  • Base reference: [1]

On one of the CLIs type the following. I'm assuming username (for connecting to my server) is "mhan" and the server address to be "pisteos.hanovate.com".

$ sudo ssh -p 2323 -l mhan -L 139:localhost:139 pisteos.hanovate.com

The above actually logs you in while forwarding the port. Optionally, you can add these parameters to suppress the log-in and only forward the port via SSH in the background. Make sure NOT to close the console.

$ sudo ssh -2qfNg -p 2323 -l mhan -L 139:localhost:139 pisteos.hanovate.com

Then on a separate terminal type the following:

$ mkdir /Volumes/sharename
$ mount -t smbfs //localhost:139/sharename /Volumes/sharename

Changing hostname that shows up on CLI

The hostname doesn't seem to change in spite of changing the computer name in Sharing preference, and NetBIOS names. This command has to be executed at the CLI to change the hostname.

$ sudo scutil --set HostName newhostname.local