3

When attempting to connect to smb://localhost/share, I receive an error that I ought to access the files locally. This is not always desirable. For example, this means I can not use my portable home on my Mac Mini that is serving the home directory.

Windows (via native SMB/CIFS) and other *nix systems (via Samba) can access local shares just fine. Why can I not do so on OS X?

3

According this this link it is possible:

https://www.chrisnewland.com/solved-mac-osx-samba-cifs-through-ssh-tunnel-error-the-server-localhost-is-available-on-your-computer-364

Finder identifies smb://127.0.0.1 as a local filesystem and refuses
to mount port 445 even if you've set up an SSH tunnel using

-L 445:localhost:445 

The solution is to alias your lo0 interface to 127.0.0.2 and Finder doesn't see this as a local address.

sudo ifconfig lo0 127.0.0.2 alias up 

Create the ssh tunnel and map to your Samba / CIFS server

ssh user@remote -L 127.0.0.2:445:smbhost:445 

Now you can open the share in Finder

smb://user@127.0.0.2
  • 1
    Thanks a lot for you anwser. I used this approach to access a virtualbox ubuntu guest on OSX. For me there has been only two little differences. First I had to create the ssh tunnel as 'sudo' and I opened the smb share with 'smb://127.0.0.2/name_of_share – rider_on_rails Jan 5 '17 at 10:36
  • Just sudo ifconfig lo0 127.0.0.2 alias up is sufficient for testing smb overhead when filesharing on a mac. – Ray Foss Feb 20 '18 at 15:51
0

Of course is difficult to give an answer without details such as OS X version, type of networking and so on.

Generally though, I experienced that by restarting File Sharing (by deselecting/selecting the checkbox from the Sharing Preference Pane) solves several issues, such as Windows machines not being able to connect to Mac shares. This issue was due to a race condition in OS X (that in 10.8.5 seems to be still not resolved) where the smb service starts before an auth service, causing it to fail when other computers try to access shared folders with any sort of privileges.

Are you trying to connect to network shares with CMD+K ? It generally works, otherwise if you click Browse you can see all the attached devices an their shares.

  • I don't think you are understanding what I'm asking. I was trying to connect to an SMB share on a Mac from the same Mac. I have since found this is not supported (which is a fundamental flaw, but oh well). – Tohuw Sep 18 '13 at 11:03
  • Sorry, I didn't catch the fact that you were connecting to localhost… I took it as placeholder ;) – mcdado Sep 19 '13 at 9:44
0

I have since found that accessing SMB shares from localhost simply isn't supported. However, I have no single authoritative documentation to cite here, but suffice it to say it cannot be done (natively).

More to the point, it is not supported to log on with a mobile account onto the server hosting the home shares - you should only use local accounts.

  • Is this still valid in OS X Server 3.1.1 on Mavericks? – unom May 20 '14 at 10:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .