owner無法chmod - Linux

Table of Contents

想請問一下各位有沒有遇過這種情況 或是有類似需求

環境
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.2 LTS
Release: 14.04
Codename: trusty

$ uname -a
Linux melinda 3.18.5-x86_64-linode52 #1 SMP Thu Feb 5 12:18:36 EST 2015 x86_64 x86_64 x86_64 GNU/Linux


檔案
$ stat somefile
File: 'somefile'
Size: 7419 Blocks: 16 IO Block: 1024 regular file
Device: 700h/1792d Inode: 65062 Links: 1
Access: (0110/---x--x---) Uid: ( 6002/ someuser) Gid: ( 6002/ someuser)

所在資料夾
$ ls . -dl
drwxr-xr-x 2 root root 1024 Nov 14 10:32 .

使用someuser卻無法chmod成755

這個平台是網路上的wargame

我自己的電腦用一樣的系統和檔案/資料夾就可以chmod

而看strace只差在一行
fchmodat(AT_FDCWD, "somefile", 0755) = -1 EPERM
fchmodat(AT_FDCWD, "local", 0755) = 0

看起來也沒有selinux相關的限制 (getenforce not found)

純粹好奇他怎麼辦到的

--

All Comments

Carol avatarCarol2015-03-29
檔案系統是?
Madame avatarMadame2015-03-30
/root/gamesdisk /games ext4 loop 0 0 這樣大概是唯讀?
Necoo avatarNecoo2015-04-01
不過mtab看是 /dev/loop0 /games ext4 rw 0 0
Callum avatarCallum2015-04-02
ext4有acl/extended attr可以看看
Edith avatarEdith2015-04-06
有很多方式可以達成,比方最簡單用 ext* 的特殊屬性
chattr +i somefile 之後該檔案就無法被異動修改