LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

Reply
 
LinkBack Search this Thread
Old 10-01-2007, 05:13 PM   #1
Cinematography
Member
 
Registered: Apr 2005
Location: Chicago, IL
Distribution: Ubuntu 9.04
Posts: 355

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


I'm trying to open a program.

I've tried:
./program
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
rsashok
Member
 
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:

#!/bin/bash

5. If the program is a script you could run it as by entering:
>source program
 
Old 10-01-2007, 07:23 PM   #3
fudam
Member
 
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:

Code:
$ 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/nuke.pl
/home/user/data/programming/perl/nuke/nuke.pl: 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
Cinematography
Member
 
Registered: Apr 2005
Location: Chicago, IL
Distribution: Ubuntu 9.04
Posts: 355

Original Poster
Rep: Reputation: 30
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:
Code:
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
 
  


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 On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are 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


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration