When the user (for example, the wu is empty) access to the home directory is set to 770 (that is, the same group user (for example, eight quit) permission for RWX), shows that eight quit can modify the files in the directory, so even if the file permissions for this directory (- RWXR -- -- -- -- --), eight quit still can pass vim, use: wq! Compulsory modify files,
But this will modify the file owner, but under normal circumstances is ordinary users to modify the file through chown owner, so this will not lead to file a certain security? Or why should such a design? Why vim command can modify the file directly to the owner? Hope bosses solutions,
Problem description may be abstract, specific situation can be seen here https://blog.csdn.net/WOD_MAAYA/article/details/116456343
Be very grateful!
CodePudding user response:
Also can do this? A test implementation?CodePudding user response:
: wq! Is mandatory writes the contents of the current buffer when open the file, you can also understand ChengXinJian a file cover the original one,Sometimes you use sudo vim editor like/etc/SSH/sshd_config file, even sudo cannot save, will use to wq! .
CodePudding user response:
As to the problem of file security, as long as I can I say with u disk boot mounted partitions can ignore you all permissions set, it is relative to safety, people who want to make it out of the question, how to set permissions again trashy also,