File permissions issue on RPi 4 NAS
Posted: Sun Jun 28, 2020 11:42 am
I've gone from total beginner on this and I'm almost there, but I'm falling at the final hurdle! I have a Pi running the latest Raspbian and it exists to host a USB drive on my local network, and also download torrents to it. The USB drive is formatted to ext4 and shared via Samba.
Here's what I've achieved...
- The samba share is visible on my local network, with guest access
- My Pi can read files from the drive
- My Mac can read and write to the drive, including creating and deleting files and folders
- My media players in the house can see the drive, browse and play the contents
- Transmission can download torrents and successfully write them to the USB drive
- I can access the Transmission web interface on my local network
And here's what I've failed at...
- My Pi cannot write to or delete files on the drive (when I'm logged in to the Pi directly, I can browse and open files but not amend, delete or create them)
- Transmission cannot autodetect a torrent file in the watch folder and automatically start it (which I believe requires access permissions to the drive, so I think may be the same issue as the bullet above, manifesting in a different way)
Because I'm not so savvy with all of this, I've listed my setup steps below, starting from a fresh install.
- Setup Samba Sharing
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install samba samba-common-bin
Y to continue, Yes to accept
sudo blkid
Get the UUID and paste into string below
sudo nano -Bw /etc/fstab
Add the below to the end of the file and write out
Add the below to the end of the file and write out
- Install transmission (sudo apt-get install transmission-daemon)
- Give it some permissions (sudo usermod -a -G pi debian-transmission)
- Edit settings (sudo nano /etc/transmission-daemon/settings.json), set password, download directories, enable incomplete directory, whitelist 10.144.*.* to enable local network computers to see the web interface, and add watch directories (comma on end of all lines except last)
- Install NordVPN (direct download method)
- Whitelist ports 137, 138, 139, 445 (Samba) and 9091 (Web access) using (nordvpn whitelist add port xxxx)
- Set up autoconnect (nordvpn set autoconnect on United_Kingdom)
Here's what I've achieved...
- The samba share is visible on my local network, with guest access
- My Pi can read files from the drive
- My Mac can read and write to the drive, including creating and deleting files and folders
- My media players in the house can see the drive, browse and play the contents
- Transmission can download torrents and successfully write them to the USB drive
- I can access the Transmission web interface on my local network
And here's what I've failed at...
- My Pi cannot write to or delete files on the drive (when I'm logged in to the Pi directly, I can browse and open files but not amend, delete or create them)
- Transmission cannot autodetect a torrent file in the watch folder and automatically start it (which I believe requires access permissions to the drive, so I think may be the same issue as the bullet above, manifesting in a different way)
Because I'm not so savvy with all of this, I've listed my setup steps below, starting from a fresh install.
- Setup Samba Sharing
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install samba samba-common-bin
Y to continue, Yes to accept
sudo blkid
Get the UUID and paste into string below
sudo nano -Bw /etc/fstab
Add the below to the end of the file and write out
sudo nano /etc/samba/smb.confUUID=[UUID string] /mnt/Media auto defaults,user,nofail 0 2
Add the below to the end of the file and write out
[Media]
comment = a_comment
path =/mnt/Media/
public = yes
only guest = yes
browseable = yes
read only = no
writeable = yes
create mask = 0644
directory mask = 0755
force create mask = 0644
force directory mask = 0755
force user = root
force group = root
- Install transmission (sudo apt-get install transmission-daemon)
- Give it some permissions (sudo usermod -a -G pi debian-transmission)
- Edit settings (sudo nano /etc/transmission-daemon/settings.json), set password, download directories, enable incomplete directory, whitelist 10.144.*.* to enable local network computers to see the web interface, and add watch directories (comma on end of all lines except last)
- Restart transmission (sudo service transmission-daemon reload)"watch-dir": “/mnt/Media/Downloads/torrent/“,
"watch-dir-enabled": true
- Install NordVPN (direct download method)
- Whitelist ports 137, 138, 139, 445 (Samba) and 9091 (Web access) using (nordvpn whitelist add port xxxx)
- Set up autoconnect (nordvpn set autoconnect on United_Kingdom)
