Operating System - Linux
1829312 Members
2767 Online
109989 Solutions
New Discussion

Re: Unable to execute files

 
Admin32
Advisor

Unable to execute files

Greetings all,

I've got a problem with one Linux Redhat 7 workstation here on our network.

It seems like we are unable to execute any new file placed into the system no matter what user you are logged in as.

For example, I logged in as root in order to install open office and even thought the "install" file is properly flagged as an executable, when running it I get a "permission denided".

The same problem exists when trying to run any other new file I copy to this system.

I'm suspecting the problem has got something to do with the system's shell environment. I tried bash and tcsh and the results were the same.

Any ideas ?

Thanks.

Chris Partsenidis.
8 REPLIES 8
Balaji N
Honored Contributor

Re: Unable to execute files

hi chris,

can u just write a single script and see if you are able to execute it.

also are there read+ execute permission for the entire directory tree and the file.

hth
-balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
Admin32
Advisor

Re: Unable to execute files

Balaji,

I've checked the directory permissions and they are fine, I've even tried chmod 777 but still the same result.

Simple scripts will not execute, same problem arises.

Cheers,
Balaji N
Honored Contributor

Re: Unable to execute files

hi can u pls try this and tell what is the error.

++++++++++
#!/bin/bash
echo abcd
++++++++++


also, see if there is /bin/bash available, and also, try executing the script like /bin/bash

hth
-balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
Admin32
Advisor

Re: Unable to execute files

Okies,

Executing the script from its directory gave me the same error, while /bin/bash 'script'

resulted in the proper execution of the script !
Balaji N
Honored Contributor

Re: Unable to execute files

hi,

how are you executing the script.

script

or

./script


try the second one. i guess your current directory is not in the path (it should not be for security).

hth
-balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
Admin32
Advisor

Re: Unable to execute files

When using ./script to execute it, I get the same error. Its definately not a path problem

/bin/bash script OR
/bin/bash /home/user/script
will work.

Balaji N
Honored Contributor

Re: Unable to execute files

hi
tried out what u say. i am unable to reproduce.

./script gives permission denied only when it doesnt have execute permission.

i hope u have checked that already. can u try some other shell , say /bin/sh or /bin/ksh.

hth
-balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
U.SivaKumar_2
Honored Contributor

Re: Unable to execute files

Hi,

The problem is that /bin directory is not added to your PATH variable.

#echo $PATH

look for /bin . if it is not there then run this command.

#export $PATH=$PATH:/bin

Edit .bash_profile and add /bin to the PATH variable declaration.

Try executing scripts now.

regards,
U.SivaKumar
Innovations are made when conventions are broken