Home  >  Article  >  php教程  >  Change the owner or group of a file or directory in Linux

Change the owner or group of a file or directory in Linux

巴扎黑
巴扎黑Original
2016-11-07 10:43:342102browse

Linux changes the owner or group of a file or directory

During the ftp upload process, if you upload a file while logging in as root in sftp mode, you will be prompted to have no permission when uploading via ftp again. The reason is because the file has already been entered as root. user, how to restore the permissions of the www user in ftp?
Then you will use the chmod command. Let’s first understand the chmod command:

chmod [-cfhvR] [--help] [--version] user[:group] file...

Change the owner or group of a file or directory in Linux

// Change the permissions and group of the rootfs folder and its subdirectories to the www group
chown –R www:www /wwwroot/zoneselr.org
// Change the owner and group of the rootfs folder and subdirectories to the user liufan and group liufan-desktop
chown –R liufan:liufan-desktop rootfs

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn