Connect a Mac to a SMB server - as Guest

Posted by ads on Wednesday, 2021-02-17
Posted in [Linux]

One of the things I do in our network is public drives. Every Linux system has a public incoming which is mapped to the primary user of the device (if there is one, like for a laptop). And this incoming shared drive can be accessed without password.

This makes it really convenient to copy files around from one laptop/user to another, or from mobile devices to laptops and vice versa, or use the printer/scanner to send the scan job directly to the laptop of the user’s device. All in all, the users like this, and use it a lot. There is also minimal protection built-in, it will only work in our home network, access is blocked when the laptop is connected to a different network. But the folders are mostly empty anyway. For sharing files over the Internet we also have a Syncthing instance running, but that’s a different story, and not as easy to use.

One thing which I was annoyed about is that by default a Mac will try to connect as a registered user. There is an option Connect as Guest, but it’s not pre-selected. Therefore every time I wanted to share something between Linux and Mac, I had to start Finder, to to Go and then Connect to Server, then click on the server from the list of last entries, and then also click on Guest. The built-in help is also not useful, as it only talks about “click on Guest”.

But it turns out that one can “pre-select” the Guest user. For this, the username is Guest, and there is no password. This goes between the protocol and the hostname. Example:




There has to be a : between the username and the (non-existent) password, and the credentials are separated from the hostname by a @. Using this connect string will auto-connect as anonymous user to the remote share. One click and a couple seconds saved!

Mac Connect to a Samba Server
Mac Connect to a Samba Server


And while I am on it, here is the configuration for Samba to create a public incoming. In the following example my username is ads and my home on my laptop is /home/ads. The incoming drive is mapped to /home/ads/incoming.

  comment = incoming
  path = /home/ads/incoming
  writable = yes
  locking = yes
  public = yes
  browseable = yes
  guest ok = yes
  force create mode = 0777
  force directory mode = 0777
  force user = ads
  preserve case = yes
  hosts allow =

All files in this incoming are automatically owned by the user, which makes it easy to work with the directory content. That’s done by the force user setting.

Categories: [Linux]
Tags: [Linux] [Mac] [Samba] [Syncthing]