LinuxQuestions.org
Help answer threads with 0 replies.
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 06-27-2005, 07:09 AM   #1
stefaandk
Member
 
Registered: Jun 2005
Distribution: Centos
Posts: 215

Rep: Reputation: 30
User executing script: bad interpreter: Permission denied


Trying to understand the fstab on one of my machines due to the following:

I'm trying to execute a shell script with a standard user called user1, the script is in his /home dir and he has full permissions but I get this error when excecuting.

/bin/sh: bad interpreter: Permission denied
--------

Apparently this has to do with my fstab???

https://www.redhat.com/archives/fedo.../msg04440.html


Anyway this is the fstab file,

I found an OK guide here:

http://www.tuxfiles.org/linuxhelp/fstab.html

But it doesnt' really answer my question and I still dunno why I can't have this user execute a script, maybe this doesn't have anythign to do with my fstab at all?
Running FC2 btw.


Code:
LABEL=/                 /                       ext3    defaults        1 1
LABEL=/backup           /backup                 ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
LABEL=/home     /home   ext3    defaults,usrquota       1       2
none                    /proc                   proc    defaults        0 0
LABEL=/tmp              /tmp                    ext3    nosuid,noexec   1 2
LABEL=/usr              /usr                    ext3    defaults        1 2
LABEL=/var              /var                    ext3    defaults        1 2
/dev/sda5               swap                    swap    defaults        0 0
none                    /dev/shm                tmpfs   noexec          0 0
 
Old 06-27-2005, 07:25 AM   #2
Zero-0-Effect
Member
 
Registered: Sep 2002
Location: Texas
Distribution: SlackWare - Current LFS - CVS
Posts: 267

Rep: Reputation: 31
I wouldnt think this would have anything to do with your fstab. What does the script suppose to do? And what are the permissions and owner,group set to on it
 
Old 06-27-2005, 07:34 AM   #3
stefaandk
Member
 
Registered: Jun 2005
Distribution: Centos
Posts: 215

Original Poster
Rep: Reputation: 30
It's a dedicated game server for BF2.
I've installed it fine on a local system and all works well if I do it all as root, however I prefer not t do run this stuff as root on the server connected to the net.

Therefore my intention was to go through the process using a specific user and then use that particular user to stop and start the game server, if it were ever compromised at least this process wouldn't run as root.
I'm also installing the files in this user's /home dir.

Maybe I can achieve this result in a better way, maybe I shoudl run the install as root still and then change all the perms and have this user still execute it?
 
Old 06-27-2005, 08:09 AM   #4
Emmanuel_uk
Senior Member
 
Registered: Nov 2004
Distribution: Mandriva mostly, vector 5.1, tried many.Suse gone from HD because bad Novell/Zinblows agreement
Posts: 1,604

Rep: Reputation: 47
newbee here: Is ist not that your script does not have the executable
flag set for user1 (same comment as Zero-effect)
what does
ls -l name_of_script
give you?
 
Old 06-27-2005, 08:16 AM   #5
stefaandk
Member
 
Registered: Jun 2005
Distribution: Centos
Posts: 215

Original Poster
Rep: Reputation: 30
Ta but script is chmodded 755, otherwise I would get a different error.

Also just foudn that I get the same error as root on this particular machine, so it's not related to using user1 which means I'm really at a loss here :/
 
Old 06-27-2005, 08:19 AM   #6
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
It is probably because the lines in your script end with CR+LF (like DOS text files) instead of LF (which is standard for Unix text files).

Yves.
 
Old 06-27-2005, 08:27 AM   #7
stefaandk
Member
 
Registered: Jun 2005
Distribution: Centos
Posts: 215

Original Poster
Rep: Reputation: 30
If that's the case, couldit still be interpreted fine on linux version and not on another? Is this a setting I can change/fix?

In my case it works on FC3 but not on an FC2 install.
 
Old 06-27-2005, 10:53 AM   #8
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Ruhr Area, Germany
Distribution: Slackware64 14.0
Posts: 1,525

Rep: Reputation: 94
I once had this problem, but it only occured when I started my script as root. The reason I found was, that (after changing to root with su) /bin/sh was not in root's path.
It's not very probable that you have the same problem, but you might check if /bin/sh is in your user's path.

 
  


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
Bash: bad interpreter, permission denied jpantone Linux - General 22 05-27-2010 07:05 AM
/bin/sh: bad interpreter: Permission denied itsaso Linux - Newbie 6 05-18-2005 11:00 AM
: bad interpreter: Permission denied LinuxRam Linux - Newbie 2 08-22-2004 10:33 PM
/bin/sh: bad interpreter: Permission denied linmix Linux - Software 12 08-16-2004 07:40 AM
perl: bad interpreter: Permission denied bulliver Linux - Software 4 01-27-2003 04:12 PM


All times are GMT -5. The time now is 02:39 AM.

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