Home > OS >  Non-root users how to delete and compressed file
Non-root users how to delete and compressed file

Time:09-29

Linux server root to create a folder in the Log, the inside of the file stored in the TXT format, use common User User login, now need to compress TXT, move to another folder, and delete a TXT file, but a hints file permissions as read-only, unable to operate, using Chmod 777 cannot delete and compression, do you have any good ways? thank you

CodePudding user response:

Change directory belong to groups, chown, directory belong to the root group, ordinary users cannot operate

CodePudding user response:

You can post your operating logs, and file permissions, error content
If permission problems, should also be insufficient permissions error, not an error file is read only

CodePudding user response:

refer to the second floor zhouchao6 response:
you can post your operating logs, and file permissions, error content
If permission problems, should also be insufficient permissions error, not an error file read-only.



I use is the mv command, moving to the target folder show success, but the source folder below TXT file cannot be deleted, and the target folder cannot be compressed,

CodePudding user response:



reference zff123 reply: 3/f
Quote: refer to the second floor zhouchao6 response:

You can post your operating logs, and file permissions, error content
If permission problems, should also be insufficient permissions error, not an error file read-only.



I use is the mv command, moving to the target folder show success, but the source folder below TXT file cannot be deleted, and the target folder cannot be compressed,


Mv is insufficient permissions, those who look at you. TXT, then you failed in the mv, under the target file. TXT file?

CodePudding user response:

Target folder has a TXT file, that is copied to the target folder, but not to delete the source folder TXT,

CodePudding user response:

reference 1st floor mouse_zhu response:
change directory belong to groups, chown, directory belong to the root group, ordinary users cannot operate

This how to operate? Unable to manually change, what kind of instruction can be changed? thank you

CodePudding user response:

Sudo chown usergroup: username VDF_LOG - R *

CodePudding user response:

refer to 7th floor mouse_zhu response:
sudo chown usergroup: username VDF_LOG - R *

Prompt error:
Sudo:/etc/sudoers is world writaable
Sudo: no valid sudoers sources found that quitting
Sudo: unble to initialize the policy of the plugin

CodePudding user response:

I USES is batch, written instructions, enter sudo after root can't enter the password,,,,

CodePudding user response:

Your current user does not have added to the sudo group, first you su root, the root, and chown usergroup: username VDF_LOG - R * change the file permissions, usergroup and the username is your user group name and user name,

CodePudding user response:

You can use sudo or su command

CodePudding user response:

Can use sudo to operate or use the su - switch to the root
  • Related