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,529
  • 19
  • 78
  • 114
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
  • i got like this:................. – KISHAN Nov 29 '16 at 05:29
  • df -T ./msp430-gcc-full-linux-installer-4.2.0.36.run Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/sda6 ext4 35845768 3258712 30743140 10% /home – KISHAN Nov 29 '16 at 05:30
  • mount|grep/dev/sda6 /dev/sda6 on /home type ext4 (rw,relatime,data=ordered) – KISHAN Nov 29 '16 at 05:32
  • for architecture check.............. ldd msp430-gcc-full-linux-installer-4.2.0.36.run_linux_x86 ldd: ./msp430-gcc-full-linux-installer-4.2.0.36.run_linux_x86: No such file or directory – KISHAN Nov 29 '16 at 05:38
  • when i check threw file command..................... file /home/kishan/dash7/msp430-gcc-full-linux-installer-4.2.0.36.run /home/kishan/dash7/msp430-gcc-full-linux-installer-4.2.0.36.run: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), statically linked, stripped ............................... – KISHAN Nov 29 '16 at 06:00
  • actually i forgot to told that i can execute a.out files,but problem occurs for .run , .bin,..etc files.. – KISHAN Nov 29 '16 at 06:41
  • when i use ldd.......... command .............. ldd msp430-gcc-full-linux-installer-4.2.0.36.run not a dynamic executable – KISHAN Nov 29 '16 at 06:46
  • thanks for giving solution........finally i have done it after updating and upgrading....................... – KISHAN Nov 29 '16 at 07:12
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,264
  • 56
  • 94
  • 147