LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   User executing script: bad interpreter: Permission denied (https://www.linuxquestions.org/questions/linux-newbie-8/user-executing-script-bad-interpreter-permission-denied-337587/)

stefaandk 06-27-2005 06:09 AM

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


Zero-0-Effect 06-27-2005 06:25 AM

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

stefaandk 06-27-2005 06:34 AM

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?

Emmanuel_uk 06-27-2005 07:09 AM

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?

stefaandk 06-27-2005 07:16 AM

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 :/

theYinYeti 06-27-2005 07:19 AM

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.

stefaandk 06-27-2005 07:27 AM

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.

titopoquito 06-27-2005 09:53 AM

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.

:twocents:


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