LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-20-2014, 07:40 AM   #1
Maria_
LQ Newbie
 
Registered: Jan 2014
Posts: 5

Rep: Reputation: Disabled
/bin/bash: ./myprogram.exe: Permission denied


Iím trying to run a program through a Matlab script on a computer with Ubuntu but I get the message:

/bin/bash: ./myprogram.exe: Permission denied

How can I fix this problem to run the program?

Iím new to Linux so can someone give me a simple explanation of why I get this message too?
 
Old 01-20-2014, 07:49 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,305

Rep: Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816
1) Ensure that what you are trying to execute is something that will actually RUN under Ubuntu. Normally anything that ends in .exe would indicate it's a Windows (or DOS!) executable.
2) Ensure the file has the permissions of at least 700 (which is read/write/execute for the owner)
 
1 members found this post helpful.
Old 01-20-2014, 07:56 AM   #3
Maria_
LQ Newbie
 
Registered: Jan 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
Hi TenTenths, thanks for your reply. How can I check and change the permissions?
 
Old 01-20-2014, 08:00 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,305

Rep: Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816
To list permissions you can use:

Code:
ls -lh /path/to/program.exe
The first section of the output will be the permissions, for example: -rwxr-xr-x which corresponds to 755

To change the permissions

Code:
chmod XXX /path/to/program.exe
Where XXX is the permission value you wish to change to.

Also man chmod will give you much more detail on permissions and how to set / check them.
 
1 members found this post helpful.
Old 01-20-2014, 08:53 AM   #5
hanshagbard
LQ Newbie
 
Registered: Jan 2014
Location: Sweden
Distribution: Ubuntu / Linux mint / SUN / Debian
Posts: 10

Rep: Reputation: 1
If you are getting a message that declines access to do so, try it with sudo to run it with administrative rights.
 
Old 01-20-2014, 10:20 AM   #6
Maria_
LQ Newbie
 
Registered: Jan 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
I've changed the permissions to -rwxr-xr-x (755) for the program I want to execute. However, when I try to execute it from the Matlab script it still gives me the message /bin/bash: ./myprogram.exe: Permission denied.
Is there something I need to do to Matlab?
 
Old 01-20-2014, 11:14 AM   #7
hanshagbard
LQ Newbie
 
Registered: Jan 2014
Location: Sweden
Distribution: Ubuntu / Linux mint / SUN / Debian
Posts: 10

Rep: Reputation: 1
try changing it to 777 to give permission to everything and all, which is not recommended to do.
 
1 members found this post helpful.
Old 01-20-2014, 11:21 AM   #8
Maria_
LQ Newbie
 
Registered: Jan 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
I've tried that too but I still get the same message. Do I need to change the Matlab permissions too?
 
Old 01-20-2014, 11:38 AM   #9
Soderlund
Member
 
Registered: Aug 2012
Posts: 185

Rep: Reputation: 81
Can MatLab run Windows executables (".exe" files)? If not, like TenTenths said, it's never going to work -- EXE files don't run on Linux. You have to run them in WINE or similar.

Try this command:

Code:
file myprogram.exe
Does it say "ELF executable"?
 
Old 01-20-2014, 11:47 AM   #10
Maria_
LQ Newbie
 
Registered: Jan 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
I've just managed to solve the problem! Thanks TenTenths and hanshagbard for your help.

I've figured out that the program I was running in Matlab was creating another program.exe which had permissions -rw-rw-r-- so it couldn't be executed. When I changed the permissions of the new program to -rwxr-xr-- the problem was solved.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] /usr/bin/xterm: Could not exec /bin/bash: Permission Denied suheng Linux - Newbie 2 09-24-2010 06:31 PM
-bash: ./PE1650_RAID_FRMW_LX_R168387.BIN: Permission denied taurustech Linux - Newbie 2 09-07-2010 12:03 PM
su: /bin/bash: Permission denied fedora4002 Linux - Security 5 01-29-2010 09:46 AM
su: /bin/bash: Permission denied dwarf007 Linux - General 10 01-20-2006 05:32 PM
Cannot execute /bin/bash: Permission denied Hegemon Linux - General 4 01-19-2004 05:13 AM


All times are GMT -5. The time now is 05:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration