There are OS Raspbian. There is a mounted mount.cifs disk in the file / mnt / share / Authorization is made under the administrator on the disk. But when trying to edit files or add new ones, there is a restriction on rights. In properties: Owner root Group root

sudo chmod 777 /mnt/share does not help, access is not available

 stat -c '%A %a %n' /mnt/share 

displays:

 drwxr-xr-x 755 /mnt/share 

the command to change the owner of the folder also did not lead to anything:

 sudo chowm -R pi /mnt/share 

The nautilus program also failed to change anything. Prompt, the problem is in my OS or after all access is blocked on a remote mounted drive. and how it can be solved. how to change the owner

  • What are the mount options? and is it possible to change / create files as root? - Fat-Zer
  • sudo mount.cifs //192.168.0.250/Share / mnt / share -o username = ***, password = *** used: cd / mnt / share / sudo touch 'test.txt' unfortunately nothing was created - bandirom
  • I tried to open the text file sudo nano and edit, the data changed, but I could not create a new file using the nano editor - bandirom
  • Team sudo cat> text.txt bash: text.txt: Denied access, is this a problem from the disk resource? - bandirom
  • one
    don't use naked sudo with redirections ... sudo cat > text.txt bash - performs cat from root, and redirection from a regular user doesn't work ... - Fat-Zer

1 answer 1

In short, when mounting remote balls ( share ) from non-POSIX systems, changing the owner and access attributes is not supported by cifs (see Note). In such cases, like foreign files such as NTFS or FAT, the user / group who will own all the files, as well as the permissions for the files / directories, must be set when mounting.

And if to speak specifically. then there are uid / gid options for setting the owner / group, as well as file_mode / dir_mode for setting permissions on files / directories.

So instead

 chowm -R pi /mnt/share 

Worth mounting with -o uid=pi

 sudo mount.cifs //192.168.0.250/Share /mnt/share -o username=***,password=***,uid=pi 

etc.; see man mount.cifs

Note: It is actually possible to use permissions from NTFS, but this is a relatively tricky exercise.

  • thank you very much! Have a great day! everything worked out - bandirom