Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16
I haven't used Linux in a while and I'm still pretty new to it so I'm a little confused. I am using SuSE 10 and I am trying to run ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2006
    Posts
    13

    bash: ./test: Permission denied


    I haven't used Linux in a while and I'm still pretty new to it so I'm a little confused. I am using SuSE 10 and I am trying to run this .exe file called test and I get the following message:

    bash: ./test: Permission denied

    Any idea as to what I should do to fix this? I am logged in as root user already...
    I tried doing chmod 777 test to see if that helped, but it didn't. Any help is much appreciated!

  2. #2
    Just Joined!
    Join Date
    Feb 2006
    Posts
    13
    also I have the same problem with other files. I tried installing my printer driver and I get a similar error:

    bash: ./EPSON-TM-USB-3_2.sh: /bin/sh: bad interpreter: Permission denied

    heeeeelllppp!!!

  3. #3
    Linux Guru techieMoe's Avatar
    Join Date
    Aug 2004
    Location
    Texas
    Posts
    9,496
    Quote Originally Posted by cooldude
    I haven't used Linux in a while and I'm still pretty new to it so I'm a little confused. I am using SuSE 10 and I am trying to run this .exe file called test...
    Do you mean you're trying to run a Linux script or something other than an EXE file? EXE files are strictly for MS Windows and MS-DOS. They will not run in Linux without some sort of special emulation.
    Registered Linux user #270181
    TechieMoe's Tech Rants

  4. #4
    Linux Guru techieMoe's Avatar
    Join Date
    Aug 2004
    Location
    Texas
    Posts
    9,496
    Quote Originally Posted by cooldude
    also I have the same problem with other files. I tried installing my printer driver and I get a similar error:

    bash: ./EPSON-TM-USB-3_2.sh: /bin/sh: bad interpreter: Permission denied

    heeeeelllppp!!!
    Try this command instead:
    Code:
    sh EPSON-TM-USB-3_2.sh
    Registered Linux user #270181
    TechieMoe's Tech Rants

  5. #5
    Just Joined!
    Join Date
    Feb 2006
    Posts
    13
    oh yeahh i forgot about that. Thanks alot! I installed the driver. I still can't run that test file though. Its a binary file.

    Before I could run it just be typing ./test in a shell konsole, now that doesn't work. It says permission denied. Any idea what I might be doing wrong?

  6. #6
    Linux Guru techieMoe's Avatar
    Join Date
    Aug 2004
    Location
    Texas
    Posts
    9,496
    Quote Originally Posted by cooldude
    Before I could run it just be typing ./test in a shell konsole, now that doesn't work. It says permission denied. Any idea what I might be doing wrong?
    Where is the file located and what user are you running it as? Also, you mentioned you chmodded it? What are its permissions currently set to? (Use ls -al)
    Registered Linux user #270181
    TechieMoe's Tech Rants

  7. #7
    Just Joined!
    Join Date
    Feb 2006
    Posts
    13
    i mounted my windows drive on SuSE and the directory is windows/D/usbtm/Linux/2.6/test
    i think chmodding it screwed something up so i deleted the file and updated with CVS so the original file is there again. The permissions are:

    -rwxrwxr-x

    I don't really know what that means but looking at properties:

    Owner can read and write
    Group can read and write
    Others can read
    Is executable

    thanks for the help.

  8. #8
    Linux Guru techieMoe's Avatar
    Join Date
    Aug 2004
    Location
    Texas
    Posts
    9,496
    Quote Originally Posted by cooldude
    The permissions are:

    -rwxrwxr-x

    I don't really know what that means
    Ok. Here's a crash course. File permissions in Linux (and UNIX/BSD) are divided up into 3 groups of 3 plus a special flag. The first one is the special flag. It's just a dash if the file is just a file. It's a d if the file is a directory. For instance

    Code:
    drw-r-x---  myStuff/
    The first 3 bits (Read/Write/Execute) are for the owner of the file. A dash means that permission is denied, while an R, W, or X means you have Read, Write, or Execute permissions for that file.

    The second 3 bits are for members of the owner's group. The same rules apply. Most regular users are generally members of the "users" group, so all "users" will have the same permissions for this file. Either the owner or root can change these permissions with chmod (as you're no doubt aware).

    The final 3 bits are for the rest of the world. This includes anyone who doesn't fall into the first 2 categories. Generally you don't want the whole world having write privileges to something unless it's a public directory.

    chmod gives you the option of using numbers rather than letters to set permissions. In binary, the highest number you can make with 3 digits is 111 (or 7 in human terms). Therefore to set RWX for your user and RWX for your group but leave the world in the dark, you would use 770.

    If you want some permissions and not others, (such as Read/Execute for group), you would subtract the 1 from whatever set you want to deny (such as the "rest of the world" group). This would give you 101, or 5 in human terms. The command would then be chmod 775.

    If all that confuses you you're still perfectly welcome to use the +r +w +x or -r -w -x command-line options with chmod as well. It's all about choice with Linux.

    That may be much more detail than you needed or wanted, but hey. Somebody might find it useful.

    ::EDIT:: I also just realized there's an even longer article on this on the front page of the forum.
    http://www.linuxforums.org/security/...rmissions.html
    Last edited by techieMoe; 04-06-2006 at 02:08 PM.
    Registered Linux user #270181
    TechieMoe's Tech Rants

  9. #9
    Linux Guru techieMoe's Avatar
    Join Date
    Aug 2004
    Location
    Texas
    Posts
    9,496
    Quote Originally Posted by cooldude
    i mounted my windows drive on SuSE and the directory is windows/D/usbtm/Linux/2.6/test
    i think chmodding it screwed something up so i deleted the file and updated with CVS so the original file is there again. The permissions are:

    -rwxrwxr-x
    In actual answer to your question, I'm not quite sure why it won't let you execute it. Have you tried giving an absolute path rather than ./ in front of the name?

    Code:
    BASH$ /mnt/windows/D/usbtm/Linux/2.6/test
    Registered Linux user #270181
    TechieMoe's Tech Rants

  10. #10
    Just Joined!
    Join Date
    Feb 2006
    Posts
    13
    hey,

    thanks for the tutorial, i had a feeling it meant read/write/executable and it was for owner, user group and public after i checked out the properties menu and made the connection, but i had no idea about the numbering system for chmod. thanks! i'm still having some sort of trouble running the binary file "test" though. i get permission denied. any other possibilities?

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •