[hadoop@worker-18 tmp]$ ./sysupdate
-bash: ./sysupdate: Operation not permitted
[hadoop@worker-18 tmp]$ chmod +x ./sysupdate
[hadoop@worker-18 tmp]$ ./sysupdate
-bash: ./sysupdate: Operation not permitted
[hadoop@worker-18 tmp]$ sudo ./sysupdate
sudo: unable to execute ./sysupdate: Operation not permitted
[hadoop@worker-18 tmp]$ ls -l ./sysupdate
-rwxrwxrwx 1 hadoop hadoop 1102480 Apr 28 07:48 ./sysupdate
[hadoop@worker-18 tmp]$ stat ./sysupdate
File: ‘./sysupdate’
Size: 1102480 Blocks: 2160 IO Block: 4096 regular file
Device: fd01h/64769d Inode: 402520 Links: 1
Access: (0777/-rwxrwxrwx) Uid: ( 1001/ hadoop) Gid: ( 1000/ hadoop)
Access: 2020-05-08 13:02:31.919594048 +0800
Modify: 2020-04-28 07:48:11.962969475 +0800
Change: 2020-05-08 13:02:29.883603300 +0800
Birth: -
[hadoop@worker-18 tmp]$ cp /usr/bin/ls ./
[hadoop@worker-18 tmp]$ ./ls --version
ls (GNU coreutils) 8.22
Written by Richard M. Stallman and David MacKenzie.
[hadoop@worker-18 tmp]$ chmod --reference=./sysupdate ./ls
[hadoop@worker-18 tmp]$ ls -l ./ls
-rwxrwxrwx 1 hadoop hadoop 117656 May 8 13:02 ./ls
[hadoop@worker-18 tmp]$ ./ls --version
ls (GNU coreutils) 8.22
Written by Richard M. Stallman and David MacKenzie.
it’s weird…
but when i uploaded it to my own server, i can execute it:
➜ ~ ./sysupdate --version
screen 2.8.5
built on Mar 8 2020 with GCC 4.8.5
features: 64-bit AES
libuv/1.34.0
so why i can’t execute sysupdate
in server worker-18
?
the os is CentOS Linux release 7.4.1708 (Core)
4
Answers
Maybe you have SElinux enabled on server?
I meet this problem too, after walking around, maybe the
/tmp
dir is mounted asnoexec
. To check this, execute:If it is mounted as
noexec
, try to remount it as executable:Maybe SELinux is another reason…
This happened to me on my RHEL 8 box. Checked (almost) everything, but at the end I found out that the culprit was
fapolicyd
running, which restricts execution policies according to file formats, directories, etc.Maybe someone else running into this issue might have the
fapolicyd
.I had this weird error "Operation not permitted" these days and I figured out the solution on my case.
This happened to my new vm on version rhel8 which used for Jenkins building job on non-root privileges. I already run ‘chown’ of every dirs that involved to build, but still get "Operation not permitted".
Finally I got solution here and here.
You can use ‘fapolicyd-cli -f add /yourdirorfile’ to make fapolicyd trust yours.
I just rudely deleted fapolicyd by ‘yum remove fapolicyd’. (Just local machine, no need this lol)