为什么 root 在尝试创建此文件夹时会出现“权限被拒绝”的情况?
root@donhy:/var/www/clients/client2/web2# mkdir bin
mkdir: cannot create directory ‘bin’: Permission denied
root@donhy:/var/www/clients/client2/web2# id
uid=0(root) gid=0(root) groups=0(root)
root@donhy:/var/www/clients/client2/web2# whoami
root
root@donhy:/var/www/clients/client2/web2# getfacl .
# file: .
# owner: root
# group: root
user::rwx
group::r-x
other::r-x
root@donhy:/var/www/clients/client2/web2# lsattr
-------------e-- ./web
-------------e-- ./private
-------------e-- ./log
-------------e-- ./ssl
-------------e-- ./tmp
-------------e-- ./cgi-bin
-------------e-- ./webdav
root@donhy:/var/www/clients/client2/web2# lsattr ..
lsattr: Operation not supported While reading flags on ../satmike.com
----i--------e-- ../web1
----i--------e-- ../web6
lsattr: Operation not supported While reading flags on ../fishingrodcaddy.com
lsattr: Operation not supported While reading flags on ../mlconsult.net
----i--------e-- ../web3
lsattr: Operation not supported While reading flags on ../vacujig.com
lsattr: Operation not supported While reading flags on ../lucycakeshop.com
----i--------e-- ../web4
----i--------e-- ../web2
root@donhy:/var/www/clients/client2/web2# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 913G 2.4G 865G 1% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 991M 4.0K 991M 1% /dev
tmpfs 200M 488K 200M 1% /run
none 5.0M 4.0K 5.0M 1% /run/lock
none 1000M 76K 1000M 1% /run/shm
none 100M 0 100M 0% /run/user
/dev/sda1 180M 34M 134M 20% /boot
root@donhy:/var/www/clients/client2/web2# cat /etc/issue
Ubuntu 14.04.2 LTS \n \l
答案1
答案就在lsattr
输出中:
# lsattr ..
----i--------e-- ../web2
该文件夹是不可变的,即使由 root 也无法改变。