What will happen if you remove the executable flag from the chmod binary itself?
root@server:~# chmod -x /bin/chmod root@server:~# root@server:~# chmod +x /bin/chmod -bash: /bin/chmod: Permission denied root@server:~# ls -ld /bin/chmod -rw-r--r-- 1 root root 51760 Apr 1 2012 /bin/chmod
How do you recover chmod in this case and make it executable again? Here is a list of possible solutions
1) perl -e 'chmod 0755, "/bin/chmod"'
2) 32 bit OS /lib/ld-linux.so.2 /bin/chmod +x /bin/chmod 64 bit OS /lib64/ld-linux-x86-64.so.2 /bin/chmod +x /bin/chmod
3) install -m a+x /bin/chmod /root/chmod /root/chmod +x /bin/chmod
4) cat > chmod.c << EOF #include<stdio.h> main() { printf("Hello World"); } EOF gcc chmod.c -o /tmp/chmod cat /bin/chmod > /tmp/chmod /tmp/chmod +x /bin/chmod
The post Just try:: chmod -x /bin/chmod appeared first on Linux - e-diary.