Whatever goes before the plus sign is the level of permission, and whatever goes after is the type of permission. User permission for yourself is u, group permission is g , and other is o. We have to describe it though, for several reasons. Second, people often use the other syntax, called absolute mode, in their documentation. Third, there are times you may actually find the absolute mode more convenient. To understand absolute mode, you have to think in terms of bits and octal notation.
A typical mode contains three characters, corresponding to the three levels of permission user, group, and other. These levels are illustrated in Figure Within each level, there are three bits corresponding to read, write, and execute permission.
You want to specify just the bit represented by the number So the chmod command would be:. To give read permission to everybody, choose the correct bit from each level: for yourself, 40 for your group, and 4 for other. The full command is:. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Ask Question.
Asked 9 years, 10 months ago. Active 2 years, 7 months ago. Viewed 83k times. Improve this question. Maybe i put it wrong. Well the exact question of my proffesor was: "Why the move of rights from a normal user isn't allowed in UNIX systems? I think the real question is: why can't non-root users use chown to give away files they own. I've seen systems where, depending on the filesystem configuration, you can. Add a comment. Active Oldest Votes. For example: If a system has disk quotas enabled, Alice could create a world-writable file under a directory accessible only by her so no one else could access that world-writable file , and then run chown to make that file owned by another user Bill.
The file would then count under Bill's disk quota even though only Alice can use the file. If Alice gives away a file to Bill, there is no trace that Bill didn't create that file.
This can be a problem if the file contains illegal or otherwise compromising data. Some programs require that their input file belongs to a particular user in order to authenticate a request for example, the file contains some instructions that the program will perform on behalf of that user. This is usually not a secure design, because even if Bill created a file containing syntactically correct instructions, he might not have intended to execute them at this particular time. Nonetheless, allowing Alice to create a file with arbitrary content and have it taken as input from Bill can only make things worse.
Improve this answer. Gilles 'SO- stop being evil' Gilles 'SO- stop being evil' k gold badges silver badges bronze badges. There is a strong argument to changing the ownership, because in my business, we get files from different users all the time and if the permission is such that you cannot do anything to the file other that read it, then we run it issues. Ubuntu Community Ask! Sign up to join this community. The best answers are voted up and rise to the top.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Is it possible to change ownership of a file without root access? Ask Question.
Asked 9 years, 10 months ago. Active 2 days ago. Viewed 68k times. Improve this question. Trent 2 2 bronze badges. Daniel Daniel 1 1 gold badge 4 4 silver badges 10 10 bronze badges. You could put incriminating data in a file and change its ownership to frame someone : I guess that's one argument against allowing what you suggest. Small addition: AFAIU you can change the owning group of a file that you own, provided that you're a member of the group you're changing to.
Add a comment. Active Oldest Votes. Improve this answer. Folfy 4 4 bronze badges. Nitin Venkatesh Nitin Venkatesh Part of this wrong.
0コメント