1

I have changed file permission_mode,but I can not run any executable file.

ls -li
chmod a+x file_name
./file_name
sudo ./file_name
Mark Kirby
  • 18,949
  • 19
  • 79
  • 116
KISHAN
  • 81

2 Answers2

1

Possible things that can prevent execution of files are:

  1. Security modules
  2. mount options
  3. binary files for a different architecture

Security modules

Things like AppArmor or SELinux can prevent executables from paths. This would be logged in the system logs I guess.

Mount options

Determine the filesystem where the binary is stored (I use df -T ./file_name and use the first column) and check mount | grep /dev/md2 to see if the noexec option is included

Architecture incompability

I use ldd ts3server_linux_x86 which might respond with

        not a dynamic executable

when the file isn't compatible with your system. My shell would respond with

zsh: no such file or directory: ./ts3server_linux_x86

if I try to execute a incompatible binary. Also like in this answer you can check with file ./file_name what architecture the binary was created at.

p_wiersig
  • 127
0

If the output of ./file_name in a shell is empty (i. e. no error messages) then it was executed successfully. The program just happened to not produce any data on stdout or stderr.

David Foerster
  • 36,890
  • 56
  • 97
  • 151