ubuntu,/var/www/目录没写写权限
天蓬老师
天蓬老师 2017-04-22 08:59:01
0
4
749

系统为ubuntu12,/var/www/ 目录的权限为:
drwxrwxr-x 3 root root 4096 Dec 24 01:35 www

为什么在www目录下创建文件或文件夹,都提示没权限啊,每次必须sudo才行,怎么解决

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(4)
小葫芦

drwxrwxr-x,从左到右第一个字母表示文件系统对象的类别,这里dRepresented as a directory (folder). Other file system objects:

-(常规文件)、d(目录)、l(符号链接)、c(字符特殊设备)、b(模块特殊设备)、p(FIFO)、s(socket)

drwxrwxr-x 除出去第一个字母d后的rwxrwxr-x表示的是三种用户关系对文件或文件夹的操作权限。从左到右每三个一组,依次表示所有者权限、组权限、其他用户权限。每组的顺序均为rwx,如果用户有相应的操作权限就用相应的字母表示,如果不具有相应的操作权限就用-表示。比如: rwxrwxr-x表示文件或文件夹的所有者具有rwx(可读,可写,可执行)的操作权限,组用户也具有rwx(可读,可写,可执行)的权限,其他用户具有r-x(readable, executable, no readable) operation permissions.

So the owner and group of the folder can be modified through sudo chmod 777 -R /var/www/ 修改其他用户操作权限或者sudo chown -R ubuntu:adm /var/www/.

Why777? You can refer to understand the operation permissions of Linux files and folders

PHPzhong

sudo chmod 777 -R /var/www/

大家讲道理

Your folder is root. Choose one of the three commands chmod, chgrp, and chown to learn about it. Just use one.

巴扎黑

Your permissions here are missing the w permission. You can chmod 777 this directory and add write permissions.
In ubuntu, your user is not root. This directory belongs to the root user, so your permissions are the last one. r-x does not have w permissions.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!