1

I wish to connect a Mac (Big Sur) to a Samba server running on a Raspberry Pi (Bullseye).

The Samba server works on the Pi, but when I try to connect the Mac to the server smb://192.168.0.237/share it times out and I get this error:

The server may not exist or it is unavailable at this time. Check the server name or IP address, check your network connection and then try again.

Here are the Samba settings on the Pi:

pi@raspberrypi:~ $ tail /etc/samba/smb.conf
[share]
Comment = Pi shared folder
Path = /home/pi/shared
Browseable = yes
Writeable = Yes
only guest = no
create mask = 0777
directory mask = 0777
Public = yes

pi@raspberrypi:~ $ tail /var/log/samba/log.smbd 
daemon_ready: daemon 'smbd' finished starting up and ready to serve connections

pi@raspberrypi:~ $ smbclient //192.168.0.237/share
Enter WORKGROUP\pi's password: 
Anonymous login successful

I can ping the Pi from my Mac and vice versa, and my Mac can talk to the Pi via VNC and Plex... But the Mac just does not seem to see the Samba server on the Pi.

Does anyone have any ideas what I might be missing?

Thanks

7
  • Have you tried Go>Network from Finder? See if it thinks it's network-visible.
    – Tetsujin
    Commented Oct 5, 2022 at 15:33
  • 1
    Thanks @Tetsujin, RASPBERRYPI appears under Go>Network, but it shows "Connecting..." for a while, then gives the same error as above.
    – Roger
    Commented Oct 5, 2022 at 16:35
  • OK. Wish I could help further, but it's not my specialist subject. This proves it is visible [rather than from command line where you're poking at something not yet 'proven' to exist] & tries to connect… but fails. I'd take a guess this is more to do with the server than the machine trying to connect, but it's only a guess, sorry.
    – Tetsujin
    Commented Oct 5, 2022 at 16:39
  • 1
    Thanks, you've been very helpful. I've been unable to connect to Netatalk either - this does look like an issue on the server end. I wonder if it's to do with Bullseye on the Pi....?
    – Roger
    Commented Oct 5, 2022 at 17:36
  • Glad it's helped a bit., at least :) Hope you find someone better informed on the Pi implementation than I can provide.
    – Tetsujin
    Commented Oct 5, 2022 at 17:42

2 Answers 2

2

This is what's working for me after trial and error on a pi4 with Raspbian and Samba.
setup: Raspbian with Samba and external HDD /dev/sda1

  • sudo apt-get update

  • sudo apt-get upgrade

  • sudo apt-get install samba samba-common-bin

  • add users to pi with: sudo adduser user1

  • add users to samba with: sudo smbpasswd -a user1

  • add users to group pi with: sudo usermod -a -G pi user1

  • group pi has already access to most upper directory: /media/pi/NAS

  • change permissions to upper most directory with: sudo chmod 777 /media/pi/NAS or sudo chmod -R /media/pi/NAS (user and group have read write)

  • create directory and do not use sudo else it belongs to root with: mkdir /media/pi/NAS/user1

  • give permissions to user1 of group pi in his share folder with: sudo chown user1:pi /media/pi/NAS/user1

edit samba configuration with: sudo nano /etc/samba/smb.conf

share settings in /etc/samba/smb.conf

[user1]
   path = /media/pi/NAS/user1
   writeable = yes
   create mask = 0775
   directory mask = 0775
   public = yes
   browseable = yes
   guest ok = yes
  • make sure that the rules below [user1] are indented with 3 spaces

  • restart samba with: sudo systemctl restart smbd

  • map network drive via File explorer in windows10 or whatever, click on This pc then on the icon MAP network drive: type in \\ip.address.of.pi\user1 or \\raspname\user1

Now if you know it works you can play with permissions and conf settings like: sudo chmod -R 740 /media/pi/NAS/user1 and like:

[user1]
   path = /media/pi/NAS/user1
   writeable = yes
   create mask = 0775
   directory mask = 0740
   public = no
   browseable = yes
   guest ok = no
1
  • Note that this is with an external HDD formatted as EXT4 Commented Nov 25, 2022 at 17:50
1

After much reading around these commands on the Pi solved my problems for SSH and Samba.

sudo ufw allow ssh
sudo ufw allow samba

I hope this helps someone else out there!

1

You must log in to answer this question.

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