Home > OS >  linux
linux

Time:09-18

If only the root and the founder of the file to the file using chnod CHGRP chown? Founder or file it should be said that the owner, the root and the owner can use the front three instructions
Daniel, please answer

CodePudding user response:

Chmod, CHGRP, chown has nothing to do with file founder, ordinary users can use the

Command access problems which can be used to view, in the/usr/bin command is ordinary users can, under the command is under/usr/sbin super users can use the
Such as which chmod result is/usr/bin/chmod, so ordinary users can use the
And as which is/usr/sbin/useradd useradd results, it shows that only the super user can use this command

CodePudding user response:

First of all thank you for your answer, the problem is that I as A common identity A create A file, for example, the owner is A, then under the identity to use chown change the owner to B is wrong, why

CodePudding user response:

This involves the problem of file permissions, in general, the default file creation is 644, which is belong to sovereignty limit for rw (reading and writing), belongs to the group and the other user permissions for r (read), but after you change the user, user is equal to the genus group you use, or other user permissions, read-only privileges, so you can't operate it, if you use chmod 777 under the root file changes to the maximum privilege, so no matter what you use the user, can be operated on this file,
Of course, from a security point of view, this is absolutely wrong

CodePudding user response:

reference yolyry reply: 3/f
this involves the problem of file permissions, in general, the default file creation is 644, which is belong to sovereignty limit for rw (reading and writing), belongs to the group and the other user permissions for r (read), but after you change the user, user is equal to the genus group you use, or other user permissions, read-only privileges, so you can't operate it, if you use chmod 777 under the root file changes to the maximum privilege, so no matter what you use the user, can be operated on this file,
Of course, from a security point of view, this is absolutely wrong

Well yes, after I took root, I am a beginner, this (can be changed by root), I feel less secure hahaha small white

CodePudding user response:

Linux system security minimum principle:
1, the system to minimize, useless bag not to install
Minimum 2, since the launch of boot, useless service does not open
3, the operation command to minimize with the rm -f a.t xt need not rm - rf a.t xt
4, login user minimized no special requirements for the login root, using ordinary users to log in to
5, ordinary users must minimize authorized only to the user management system of the command
6, file and directory permissions set to minimize prohibit optional create, change, delete the file
Novice learning can use root, of course, as far as possible don't use the rm command, especially easy to hang up the system, the orders of the other problem is smaller