LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-17-2005, 05:12 PM   #1
darin3200
LQ Guru
 
Registered: Dec 2002
Distribution: Gentoo!
Posts: 1,153

Rep: Reputation: 45
SU/program execution permission problems


Hi,
I'm having some troubles. I compiled a C program and didn't get any errors. I go to run the program and get this
Code:
darinf@localhost c $ ./program
-bash: ./program: Permission denied
Here is 'ls -l' output
Code:
-rwxrwxrwx  1 darinf users 13641 Aug 17 16:34 program
I also ran
Code:
chmod u+x program
and still nothing. I also go to su to root and I can't, I type the password and get "Permission denied" although I can use the same password to log in as root, just not su to root. And when root I still get the same errors when running the program.

Any help is greatly appreciated

Thanks,
Darin
 
Old 08-18-2005, 09:52 AM   #2
SlackerLX
Senior Member
 
Registered: Dec 2004
Location: Herzliyya, Israel
Distribution: SuSE 10.1; Testing Distros
Posts: 1,832

Rep: Reputation: 47
Try to set root password in more traditional UNIX fashion,
you can set the root password by typing
#sudo passwd root.

This will allow you to use su or login as root on the console.

If you need a shell with root privileges, run
#sudo -s
 
Old 08-18-2005, 09:32 PM   #3
darin3200
LQ Guru
 
Registered: Dec 2002
Distribution: Gentoo!
Posts: 1,153

Original Poster
Rep: Reputation: 45
Yeah, that should work, but I'm still wondering what happened and why all ther permissions are messed
 
Old 08-19-2005, 05:11 AM   #4
SlackerLX
Senior Member
 
Registered: Dec 2004
Location: Herzliyya, Israel
Distribution: SuSE 10.1; Testing Distros
Posts: 1,832

Rep: Reputation: 47
But usually when I run externally GCC built program as user, Linux requests permissions.
chmod -x
 
Old 08-19-2005, 04:32 PM   #5
darin3200
LQ Guru
 
Registered: Dec 2002
Distribution: Gentoo!
Posts: 1,153

Original Poster
Rep: Reputation: 45
But wouldn't chmod -x make the program unexecutable?
 
Old 08-20-2005, 01:00 AM   #6
SlackerLX
Senior Member
 
Registered: Dec 2004
Location: Herzliyya, Israel
Distribution: SuSE 10.1; Testing Distros
Posts: 1,832

Rep: Reputation: 47
Sorry, I mistyped
chmod +x
 
Old 08-20-2005, 11:24 AM   #7
darin3200
LQ Guru
 
Registered: Dec 2002
Distribution: Gentoo!
Posts: 1,153

Original Poster
Rep: Reputation: 45
I didn't think it was necessary to make a compiled C prog. executable, but i tried and it still didn't work. Also, some interesting shell scripting problems are coming up, for instance, after creating a hello world script here is what happens
Code:
darinf@localhost c $ chmod u+x test
darinf@localhost c $ ./test
-bash: ./test: /bin/bash: bad interpreter: Permission denied
darinf@localhost c $ /bin/bash test
Hello world
I don't know if this is related, but still interesting
 
Old 08-20-2005, 11:35 AM   #8
SlackerLX
Senior Member
 
Registered: Dec 2004
Location: Herzliyya, Israel
Distribution: SuSE 10.1; Testing Distros
Posts: 1,832

Rep: Reputation: 47
Do you think to check it again with GCC will make any sense?
Just yesterday one our member sent me his program compiled with g++ and I had the same thing, but typing
#su
#chmod +x lesson
solved the bugger
 
Old 08-20-2005, 10:03 PM   #9
darin3200
LQ Guru
 
Registered: Dec 2002
Distribution: Gentoo!
Posts: 1,153

Original Poster
Rep: Reputation: 45
Fixed one of the problems! It turns out the programs are on a seperate harddrive, a hardrive that doesn't have exectuable permisisons, everything works fine in /

But su still doesn't work :|
 
  


Reply



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
c++ redirect program execution blizunt7 Programming 6 09-13-2005 12:09 PM
script execution - file/directory permission issue serksimper Linux - Enterprise 1 08-10-2005 03:01 PM
cvs rtag: script execution failed: permission denied markpetit Linux - Software 0 05-25-2005 11:47 AM
execution of one program inside of another microsoft/linux Programming 2 03-18-2005 10:24 AM
Key bindings program (custom pasting, program execution, etc.) jrdioko Linux - Software 2 02-05-2005 09:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:04 PM.

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
Open Source Consulting | Domain Registration