Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5460

Networking and servers • Re: Can't get MacOS drive mounted on Pi Zero 2 W

$
0
0
Thanks for your suggestion. I was able to figure out my issue. Since I was specifying my Mac's login name and password in the mount command, the mounted folder should not include the "/Users/Dave" file path. Instead, this is what worked:

sudo mount -t cifs -o user=dave,password=xxxxx,rw,file_mode=0777,nounix,sec=ntlmssp,uid=$(id -u),gid=$(id -g),forceuid,forcegid, //192.168.50.114/pi_videos /home/pi/mac_videos

I also made sure I had a folder on the Raspberry Pi system called "/home/pi/mac_videos".

Glad you got it working but I do have some further comments:
  • Does your Mac expose a share called "pi_videos"? If it doesn't I'd expect that to fail. The syntax is //servename-or-ip/sharename[/directory]. Of course MacOS may do things differently than Samba or Windows on the server side.
  • You may not need nounix in the mount options because unix extension are only available if the server supports them and both client and server use smbv1.
  • You don't need both of "file_mode=0777" and "uid=$(id -u),gid=$(id -g)". The first grants full access to everyone regardless of whether they are the owner or a member of the group.
  • "uid=$(id -u),gid=$(id -g)" will always resolve to a uid and gid of 0 (because of sudo). That's root which is unwise. Root is also the default owner and group if these options are not specified.*
  • Unles you want ewvery file shared to the Pi from the Mac to be execuatble. file_mode=0666 is likely a better option. DIrectories do need the x bit set though. See below.
  • You may also wish to set dir_mode=777. With you're current options directories will get the default permissions. And as they'll be owned by root other users likely won't be able to access them.
  • Having the password in the mount command is not a secure thing to do. Anyone who can see your command history (it's a file in your home directory) can see your password as can anyone who happens to run, say, ps aux at the right time. It's even worse if you're planning to mount the share at boot (or login) via rc.local /etc/fstab,l or .bashrc (or .profile) or autostart in the desktop.
    A credentials fiel is better but only if permissions on it are correctly set (root:root 600). If you're going to type that command as requied though just include user=dave and enter the password when prompted.
*: Actually it's that of the user doing the mount but when using sudo that's root. And without specific configuration normal users can't use mount anyway.

Statistics: Posted by thagrol — Tue Mar 05, 2024 12:40 am



Viewing all articles
Browse latest Browse all 5460

Trending Articles