Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 10-01-2007, 05:13 PM   #1
Registered: Apr 2005
Location: Chicago, IL
Distribution: openSUSE 13.1
Posts: 357

Rep: Reputation: 31
bash: ./program: permission denied

I'm trying to open a program.

I've tried:
sudo ./program
sh ./program
sudo sh ./program
sudo chmod 777 program
sudo chmod a+rwx program
sudo chmod a+rwX program

But none of these work.

At one time I was able to just click the program to open it, but I messed that up by changing the file association to sh. Now the 'execute' option is gone.

Any help on a way to fix this would be greatly appreciated. I'm using Xubuntu (Ubuntu) 7.04, and the program is called mupen64.
Old 10-01-2007, 06:07 PM   #2
Registered: Nov 2006
Location: USA, CA
Distribution: RedHat, Debian
Posts: 202

Rep: Reputation: 31
Are you trying to open a file? Or to run a program? I assume that you meant to run a program.
1. Make sure that the program is in your current directory by entering 'ls -l' at the command prompt.
2. If the command is there then make sure that is has 'execute' attribute, if not then
chmod +x program
3. It should be any messages about permission denied, and you don't need to do any 'sudo ...' (BTW: if you insist on doing 'sudo' make sure that permissions in 'sudoers' file are set correclty)
4. If the 'program' is bash script then the first line should read:


5. If the program is a script you could run it as by entering:
>source program
Old 10-01-2007, 07:23 PM   #3
Registered: Feb 2006
Distribution: FC
Posts: 86

Rep: Reputation: 15
rsashok brings up a good point of knowing what type of file it is you're trying to execute. You can do this with the "file" command. Some examples from my system:

$ file /bin/ls
/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped

$ file ~/data/programming/perl/nuke/
/home/user/data/programming/perl/nuke/: directory

$ file ~/data/programming/perl/nuke/
/home/user/data/programming/perl/nuke/ perl script text executable
Sharing your return value will help understand what you're trying to execute.
Old 10-01-2007, 08:18 PM   #4
Registered: Apr 2005
Location: Chicago, IL
Distribution: openSUSE 13.1
Posts: 357

Original Poster
Rep: Reputation: 31
Thank you for the replies!

chmod +x file worked, but it only did when I moved the program from my xfs sda4 partition to my ext3 home folder.

Here is the output for the file command:
file mupen64
mupen64: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.4.1, dynamically linked (uses shared libs), stripped


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot execute bash: permission denied flipwhy Linux - Newbie 11 11-12-2007 10:49 AM
bash: Permission Denied Panagiotis_IOA Slackware 5 11-07-2006 10:25 PM
su: /bin/bash: Permission denied dwarf007 Linux - General 10 01-20-2006 04:32 PM
bash: /etc/profile: Permission denied Kanon Linux - Newbie 4 01-21-2005 08:01 AM
RH7.2 bash: permission denied Korshun Linux - Distributions 3 04-29-2002 10:22 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:27 PM.

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