09-23-2024, 09:24 PM
In the auto-mount conf file (/etc/udisks-glue.conf) the permissions mask assigned to Fat32 and NTFS drives is 0022 which translates to the permissions and ownership below.
This permission block has three parts: Owner:drwx Group:r-x Other:r-x meaning Owner has read/write/execute, Group has Read/Execute and All Other Users also have Read/Execute. Owner = root, Group = root.
This basically means that with the above permissions root access is required to write to the drive. There is no root user defined on moode images for obvious security reasons. To get root access to files one must explicitly prefix local commands with sudo or the connecting sftp client for example FileZilla must do this.
In a quick test with FileZilla on my Mac there is no option for root access using sftp protocol. It connects using the user id and password you set in the Pi Imager when the image was created.
Here's what can be done providing your drives are formatted as either Fat32 or NTFS. Edit the file /etc/udisks-glue.conf (below) and change dmask and fmask from 0022 to 0000. Reboot and the drives will have the following permissions which provide Read/Write/Execute access for Owner, Group and All Other Users.
/etc/udisks-glue.conf
Code:
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
This permission block has three parts: Owner:drwx Group:r-x Other:r-x meaning Owner has read/write/execute, Group has Read/Execute and All Other Users also have Read/Execute. Owner = root, Group = root.
This basically means that with the above permissions root access is required to write to the drive. There is no root user defined on moode images for obvious security reasons. To get root access to files one must explicitly prefix local commands with sudo or the connecting sftp client for example FileZilla must do this.
In a quick test with FileZilla on my Mac there is no option for root access using sftp protocol. It connects using the user id and password you set in the Pi Imager when the image was created.
Here's what can be done providing your drives are formatted as either Fat32 or NTFS. Edit the file /etc/udisks-glue.conf (below) and change dmask and fmask from 0022 to 0000. Reboot and the drives will have the following permissions which provide Read/Write/Execute access for Owner, Group and All Other Users.
Code:
Access: (0777/drwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root)
/etc/udisks-glue.conf
Code:
match vfatdisks {
automount = true
automount_options = {noexec,nodev,noatime,nodiratime,'dmask=0022','fmask=0022'}
post_mount_command = '/var/www/util/automount.sh add_mount_udisks "%mount_point"'
post_unmount_command = '/var/www/util/automount.sh remove_mount_udisks "%mount_point"'
}
match ntfsdisks {
automount = true
automount_options = {noexec,nodev,noatime,nodiratime,'dmask=0022','fmask=0022'}
post_mount_command = '/var/www/util/automount.sh add_mount_udisks "%mount_point"'
post_unmount_command = '/var/www/util/automount.sh remove_mount_udisks "%mount_point"'
}