Cannot change permissions linux

File permissions won’t change

sorry fresh user. I installed about 9 days ago and had issues with Unity disappearing which took 5 days of headaches to fix. It never did fix, I reinstalled. I set up Plex (media server) and while the server is running and can be accessed by external network devices, I can’t add files. Plex says this is because of permissions. I have gone up and down the forums here and at Plex to get an answer. It seems everyone says

chmod -R 755 /media/My\ Book/Videos 

will change permissions to allow the folder «Videos» on my external USB 2.0 NTFS 3TB Western Digital drive (which is mounted and accessible through the file manager) as well as every sub-directory and file contained therein to be accessible to user «Plex». I have used file manager and as soon as you click to change permissions it changes right back. When I chmod with -c it tells me every file is changed (usually 600) to 755 as I commanded it to do. I did

to verify and there is no change. (I also used ls -l to make sure I knew who the owner was and it is me (mvl1014). ls -al gives me the same info.) I swear to god I tried to sudo it and after smashing my head against this keyboard for basically the entirety of my day, I tried it as root. I was scared shi-less but couldn’t come up with anything else. sudo su to root and then chmod -R -c /media/My\ Book/Videos Same result. -c told me every single file was changed and a check in Unity or in terminal confirmed not a darn thing changed. Now it seems to me that even if that isn’t the thing stopping Plex from working there is still a problem with this command not going through. 12.04LTS — on gen 1 i7 (2.7 GHz I believe) with 6 GB ram I’ve attempted to attach a screenshot but I’m told I need 10 reps to do so, which means I’m copy/pasting too. Please excuse my obfuscation, but Lorem Ipsum seemed unnecessary. And I tried multiple ways to format this but it looks perfect every way and messed up each time in the preview below. (Ugh, I’m a mess.)

$ chmod -R -c 755 /media/My\ Book/Videos . . . mode of `/media/My Book/Videos/xxxx/xxxx/xxxx.mkv' changed from 0600 (rw-------) to 0755 (rwxr-xr-x) 
mvl1014@FX6800:/media/My Book/Videos$ ls -al total 88 drwx------ 1 mvl1014 mvl1014 0 Aug 28 15:17 . drwx------ 1 mvl1014 mvl1014 20480 Sep 3 14:29 .. drwx------ 1 mvl1014 mvl1014 8192 Aug 28 15:18 xxxx drwx------ 1 mvl1014 mvl1014 49152 Aug 16 14:02 xxxx drwx------ 1 mvl1014 mvl1014 8192 Aug 27 21:36 xxxx drwx------ 1 mvl1014 mvl1014 4096 Jul 23 19:09 xxxx 

I apologize if this has been asked. I looked through this place plus at all the suggested «Similar Questions». The closet thing I got to an answer was here, but running the provided code with my own UID didn’t work either.

Читайте также:  Linux for plex media server

Источник

chmod changing permissions of operation not permitted

You got this error because your user is not the owner of /root folder. So you can’t change the permission of your folder other than the root user. You need to switch to your root account and run the commands as shown below. I hope this will solve your error.

What is the meaning of chmod 755?

755 means read and execute access for everyone and also write access for the owner of the file. When you perform chmod 755 filename command you allow everyone to read and execute the file, the owner is allowed to write to the file as well.

What is chmod 400 command?

chmod 400 myfile — Gives the user read permission, and removes all other permission. These permissions are specified in octal, the first char is for the user, second for the group and the third is for other.

What is the meaning of chmod 777?

Setting 777 permissions to a file or directory means that it will be readable, writable and executable by all users and may pose a huge security risk. . File ownership can be changed using the chown command and permissions with the chmod command.

Why is Operation not permitted in Linux?

When a directory or a file has immutable attribute set, you will get the error “Permission denied” while trying to delete the underlying files. If the attribute i (immutable bit) is set on a file, not even root will be able to modify it.

How do I change my chmod?

  1. chmod +rwx filename to add permissions.
  2. chmod -rwx directoryname to remove permissions.
  3. chmod +x filename to allow executable permissions.
  4. chmod -wx filename to take out write and executable permissions.

What chmod is — R —?

The chmod utility lets you change any or all of the file permission mode bits of one or more files. For each file that you name, chmod changes the file permission mode bits according to the mode operand.
.
Octal Modes.

Octal number Symbolic Permission
4 r— Read
5 r-x Read/execute
6 rw- Read/write
7 rwx Read/write/execute

What does chmod 666 do?

chmod 666 file/folder means that all users can read and write but cannot execute the file/folder; . chmod 744 file/folder allows only user (owner) to do all actions; group and other users are allowed only to read.

What does chmod 644 mean?

Permissions of 644 mean that the owner of the file has read and write access, while the group members and other users on the system only have read access.

What does chmod 444 do?

Here is what the numbers mean: 444 = (r— r— r—): owner/group/others are all only able to read the file. They cannot write to it or execute it. . 755 = (rwx r-x r-x): owner can read, write and execute the file, members in the user group and others can read and execute the file but cannot write to it.

What is chmod 500 script?

Q: What «chmod 500 script» do? Makes script executable for script owner.

What happens when we run chmod 500 script sh?

500 : set read+execute permission to the user , set no permissions to the group and set no permissions to the others .

Читайте также:  Linux update user name

How to find Ubuntu Version, Codename and OS Architecture in Shell Script

Shell

How to find Ubuntu Version, Codename and OS Architecture in Shell ScriptGet Ubuntu Version. To get ubuntu version details, Use -r with lsb_release com.

How to Secure the SSH Server in Ubuntu 20.04 from Basic to Advanced

Secure

Method of Securing the SSH Server in Ubuntu 20.04:sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak.sudo sshd –T.sudo nano /etc/ssh/sshd_config.su.

Find Disk Space Used by Specific User Linux

Command

Check Disk Usage in Linux Using the du Command du -sh /home/user/Desktop — the -s option will give us the total size of a specified folder (Desktop in.

Latest news, practical advice, detailed reviews and guides. We have everything about the Linux operating system

Источник

Why can’t I change the permissions of files I have access to?

So shouldn’t I be able to change other permissions since I have access to the file? I’m not an expert on the user/group stuff. So this is just perplexing me. I’m trying to run: chmod o-r * I realize I can do it with sudo, easily, but I’m trying to understand why I can’t modify the files without sudo.

I haven’t tried this but I’m pretty sure only the owner or root can change the permissions, even though the group can write to them. (Posted as a comment because I’m not 100% certain)

2 Answers 2

Only The Owner of a File May Change Its Permissions

As jackweirdy commented, only the owner of a file (or root ) can change the file’s permissions. Being a member of a group that has some kind of access to the file does not impart the ability to change the file’s permissions.

The idea is that a file is owned by a user (whether that user represents a real person, or not), and that user is the one who decides who gets access to the file. Permissions for access by users (who are not the owner) in the group-owner of the file are controlled by the user who owns the file. If anyone in the file’s group-owner could change the file’s permissions, this security model would be broken.

For example, consider these permissions, as in your specific situation:

The owner can read and write the file but cannot execute it. The users in the group-owner besides the owner of the file can also read and write the file but not execute it. Others may only read the file.

Suppose www-data (or someone with the ability to run commands as www-data or as root ) set those permissions with the intention of keeping other users in the group-owner from executing the file. If other users in the group-owner could change the permissions, they could run:

And then they would gain the ability to execute the file. Such an ability would render group permissions worthless.

In contrast, the reason for user permissions, even though the user owns the file, isn’t to restrict the owner from doing anything with the file, but is rather to protect the user from doing things with the file they don’t want to do. For example, files that aren’t programs, or that might be programs but have just been obtained from an untrusted source like the Internet, tend to have the execute bit set to 0 even for the owner, for their own benefit. In this case, it’s helpful and necessary for the owner to be able to change this.

A separate problem with allowing members of the group-owner (who aren’t the owner) from changing permissions is that this is a separate ability not accounted for by r , w , or x . Even if the group had read, write, and execute permissions wouldn’t necessarily mean that they should be able to change the permissions. (For example, suppose you have a file where the owner is not a member of the group-owner. If members of the group-owner could change the permissions, they could deprive the owner of permissions. The owner could change this back. but this would still break any automated tasks the user had scheduled that use the file.)

Читайте также:  Windows linux development environment

Allowing People to Become The Owner

When a file is owned by a user like www-data who doesn’t represent any actual person, you might want to allow some people to perform actions as that user. sudo doesn’t just facilitate allowing select users to run commands as root . It also facilitates allowing select users to run command as other specified users. You could set things up so that everyone in the www-data group has the ability to run commands as the www-data user, including changing permissions on files owned by www-data . (Make sure you understand the implications of this, though. Depending on how your system is configured, users in www-data may be able to schedule tasks to run as www-data , and will be able to do anything at all to any file owned by www-data and to any process run as www-data .)

See man sudoers for information about how to set this up. If you decide you want to do this and you have trouble, you could post a separate question about it.

Allowing Non-Owners to Change the File’s Permissions?

I think it may be possible to allow some users who don’t own a file to change some or all of the file’s permissions, using Access Control Lists. I’ve hardly used ACLs on Ubuntu though. If you’re interested in accomplishing this, you might want to post another question asking if it’s possible and, if so, how to do it.

Источник

Root cannot change file permission or ownership

Usually root does not have special permissions on NFS shares. On the contrary: root is mapped to an ordinary user (i.e. does not even have «normal» read and write access to root files).

You must run chown on the NFS server.

It’s typically the case that the local root user on NFS clients is disallowed from performing these types of activities on NFS mounted shares. NetApp appears to add a bit of a twist on this as follows:

  • By default, the anon option specifies a UID of 65534. That is, if you do not use the root and anon options for a resource, root users on all hosts access the resource using the UID 65534.
  • If the anon option specifies a UID of 65535, root access is disabled.
  • If the anon option specifies a UID of 0, root access is granted to all hosts.
  • If a name is provided instead of a UID, that name is looked up according to the order specified in the /etc/nsswitch.conf file to determine the corresponding UID to be assigned by the anon option.

So from the looks of it the NetApp NFS share has the default option, #1. You could confirm this by touching a file on the NFS share as root and seeing what ID results from doing this.

You should be able to see the NFS share’s exported options using mount -v on your NFS client.

$ mount -v . mulder:/export/raid1/home/sam on /home/sam type nfs (rw,intr,tcp,nfsvers=3,rsize=16384,wsize=16384,addr=192.168.1.1) 

References

Источник

Оцените статью
Adblock
detector