Jump to content

Linux CIFS windows share how to remove files

I recently set up a linux server to act as a Plex server for me, my file storage is on a windows 10 machine acting as a file server. I am using cifs to auto mount the share to the linux box so that Plex can access it on boot without me having to mount it every time the system reboots. This all works fine, the problem is that if I try to remove a file ether in Plex or via the terminal it tells me that the file is write-protected and will fail to remove the file (Plex just fails). But on other windows machines I can remove files as will without issue. Is there a way to allow my linux box to remove files from this windows share? 

Linux OS: CentOS

Link to comment
Share on other sites

Link to post
Share on other sites

I would check the read write permissons and or owner of the share. 

 

For example (unsafe but the big gun) Chmod "folderpath like /usr/share/plex or you name it) -r 777

 

This should set the permission to read write and execute to all users on that given folder and subfolders... 

 

Main System:

Anghammarad : Asrock Taichi x570, AMD Ryzen 7 5800X @4900 MHz. 32 GB DDR4 3600, some NVME SSDs, Gainward Phoenix RTX 3070TI

 

System 2 "Igluna" AsRock Fatal1ty Z77 Pro, Core I5 3570k @4300, 16 GB Ram DDR3 2133, some SSD, and a 2 TB HDD each, Gainward Phantom 760GTX.

System 3 "Inskah" AsRock Fatal1ty Z77 Pro, Core I5 3570k @4300, 16 GB Ram DDR3 2133, some SSD, and a 2 TB HDD each, Gainward Phantom 760GTX.

 

On the Road: Acer Aspire 5 Model A515-51G-54FD, Intel Core i5 7200U, 8 GB DDR4 Ram, 120 GB SSD, 1 TB SSD, Intel CPU GFX and Nvidia MX 150, Full HD IPS display

 

Media System "Vio": Aorus Elite AX V2, Ryzen 7 5700X, 64 GB Ram DDR4 3200 Mushkin, 1 275 GB Crucial MX SSD, 1 tb Crucial MX500 SSD. IBM 5015 Megaraid, 4 Seagate Ironwolf 4TB HDD in raid 5, 4 WD RED 4 tb in another Raid 5, Gainward Phoenix GTX 1060

 

(Abit Fatal1ty FP9 IN SLI, C2Duo E8400, 6 GB Ram DDR2 800, far too less diskspace, Gainward Phantom 560 GTX broken need fixing)

 

Nostalgia: Amiga 1200, Tower Build, CPU/FPU/MMU 68EC020, 68030, 68882 @50 Mhz, 10 MByte ram (2 MB Chip, 8 MB Fast), Fast SCSI II, 2 CDRoms, 2 1 GB SCSI II IBM Harddrives, 512 MB Quantum Lightning HDD, self soldered Sync changer to attach VGA displays, WLAN

Link to comment
Share on other sites

Link to post
Share on other sites

Thanks, didn't expect that file permissions on the linux side would play a role. Just started into linux, and learning.

Link to comment
Share on other sites

Link to post
Share on other sites

25 minutes ago, Anghammarad said:

I would check the read write permissons and or owner of the share. 

 

For example (unsafe but the big gun) Chmod "folderpath like /usr/share/plex or you name it) -r 777

 

This should set the permission to read write and execute to all users on that given folder and subfolders... 

 

I thought that this worked, but it seems to have only worked for the root account, when I look at the file permissions they are unchanged. "drwxr-xr-x. 2 500 500 0 Dec  1"

Link to comment
Share on other sites

Link to post
Share on other sites

Found it, It was in mount command. I had "dir_mode=0755,file_mode=0755" in the mount command I changed it to "dir_mode=0777,file_mode=0777" and that updated it. 

What trouble one can get into when fallowing guide and only knowing enough to be dangerous. I have never used numbers for the file permissions yet, so I was just like sure, that looks good, copy paste, woo it mounted.

Link to comment
Share on other sites

Link to post
Share on other sites

17 minutes ago, ForcedHero said:

I thought that this worked, but it seems to have only worked for the root account, when I look at the file permissions they are unchanged. "drwxr-xr-x. 2 500 500 0 Dec  1"

You should have this share set up in a folder under your home folder. Not under anywhere that requires root access. It's safer that way.

 

Also, what distro are you using? If you are using a distro with the KDE Plasma desktop, you can set up a share through the Dolphin file manager. It's way easier that way. Rather than editing config files.

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, ForcedHero said:

Found it, It was in mount command. I had "dir_mode=0755,file_mode=0755" in the mount command I changed it to "dir_mode=0777,file_mode=0777" and that updated it. 

What trouble one can get into when fallowing guide and only knowing enough to be dangerous. I have never used numbers for the file permissions yet, so I was just like sure, that looks good, copy paste, woo it mounted.

Main problem with this is that having the permissions of something be 777 is extremely insecure. If you can avoid that, do it. 

 

the solution will probably be to change the owner of the directory. See if something like "sudo chown -R $USER /path/to/plex/library" will work.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, RONOTHAN## said:

Main problem with this is that having the permissions of something be 777 is extremely insecure. If you can avoid that, do it. 

 

the solution will probably be to change the owner of the directory. See if something like "sudo chown -R $USER /path/to/plex/library" will work.

I would just change the directory of the folder to be shared to a sub directory of the user profile under the home folder. Like you say, it's insecure to use 777 under a root folder no less.

Link to comment
Share on other sites

Link to post
Share on other sites

21 minutes ago, RONOTHAN## said:

Main problem with this is that having the permissions of something be 777 is extremely insecure. If you can avoid that, do it. 

 

the solution will probably be to change the owner of the directory. See if something like "sudo chown -R $USER /path/to/plex/library" will work.

I tried doing that first, and it didnt work. I am thinking that everything is set in the mount command in fstab

Link to comment
Share on other sites

Link to post
Share on other sites

19 minutes ago, D-reaper said:

I would just change the directory of the folder to be shared to a sub directory of the user profile under the home folder. Like you say, it's insecure to use 777 under a root folder no less.

I the plex server is running as a service, so my understanding is that it dosnt work in a /home directory so I put the plex library in a new / directory that I created only for the plex media

Link to comment
Share on other sites

Link to post
Share on other sites

23 hours ago, ForcedHero said:

I the plex server is running as a service, so my understanding is that it dosnt work in a /home directory so I put the plex library in a new / directory that I created only for the plex media

Hmm. I used Plex before a long time ago. Briefly for streaming. But I opted for sftp instead to stream and add/remove files. It just felt easier and lighter.

 

But if you are just looking to share files, a simple Samba setup will suffice like I was mentioning.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×