"Permission Denied" when trying to open a file in Terminal

Discussion in 'macOS' started by Juventino, Feb 11, 2011.

  1. Juventino macrumors member

    Joined:
    Jun 26, 2010
    Location:
    Tehran
    #1
    Hi everyone
    I was trying to open a file (a keygen to be more precise).it was non-executable so I used chmod +x command in terminal and everything went well to this point.after this when I tried to open the file i got the "Permission Denied" error.
    I tried the sudo command but it couldn't do the job either.
    I created another admin account and everything worked with no problem.
    so what's wrong with the account I use now? How can I make it right?
    Thanks in advance
     
  2. LPZ macrumors 65816

    Joined:
    Jul 11, 2006
    #2
    Please do the following:

    1) Open Terminal (in Utilities).

    2) Type the following into Terminal, leaving a space after the final character. Do not press return yet.

    Code:
    ls -l 
    (That's lowercase-L before the s and after the hyphen.)

    3) Drag the file you wish to open and drop it into the Terminal window. This will append the file's location to the command you entered, but will not actually move the file.

    4) Now click on the Terminal window to make it active, and press return.

    5) Copy and post the complete output.
     
  3. chriszzz macrumors 6502

    Joined:
    Oct 29, 2008
    #3
    So you're trying to pirate software with a keygen?

    Figure it out on your own. No one here should help you steal software.
     
  4. Juventino thread starter macrumors member

    Joined:
    Jun 26, 2010
    Location:
    Tehran
    #4
    This is what I get :
    Code:
    -rw-r--r--  1 Amin  staff  30725 Jan 17 05:47 /Users/Amin/Desktop/keygen_osx
    
    
     
  5. Juventino thread starter macrumors member

    Joined:
    Jun 26, 2010
    Location:
    Tehran
    #5
    first of all i did figure it out and you can consider the software "stolen" !
    second of all, what difference does it make what kinda file it is ? my problem's not just about the keygen.
     
  6. LPZ macrumors 65816

    Joined:
    Jul 11, 2006
    #6
    The file is owned by Amin, who has permission to read and write. The file is not executable.

    User Amin should be able to read/write to this file (assuming it's a text file) using TextEdit (for example).
     
  7. Sirobin macrumors 6502

    Sirobin

    Joined:
    May 6, 2008
    Location:
    California
    #7
    Try

    chmod u+x keygen_osx

    and then see if you can execute it.
     
  8. Juventino thread starter macrumors member

    Joined:
    Jun 26, 2010
    Location:
    Tehran
    #8
    I log in with the account Amin
    tried the chmod u+x, still the same result :

    Code:
    
    Last login: Sat Feb 12 16:30:38 on console
    Amins-MacBook:~ Amin$ chmod u+x/Users/Amin/Desktop/keygen_osx 
    usage:	chmod [-fhv] [-R [-H | -L | -P]] [-a | +a | =a  [i][# [ n]]] mode|entry file ...
    	chmod [-fhv] [-R [-H | -L | -P]] [-E | -C | -N | -i | -I] file ...
    Amins-MacBook:~ Amin$ /Users/Amin/Desktop/keygen_osx 
    -bash: /Users/Amin/Desktop/keygen_osx: Permission denied
    
     
  9. Beaverman3001 macrumors 6502

    Joined:
    May 20, 2010
    #9
    This is kind of obvious, but did you repair permissions on the drive yet? Also with the last command you posted, you left out a space between u+x and the path, so that command isn't valid. If it worked on one account and not another you should also consider you might have mistyped.
     
  10. LPZ macrumors 65816

    Joined:
    Jul 11, 2006
    #10
    In Terminal, enter

    Code:
    chmod 755 ~/Desktop/keygen_osx
    to make the file executable.

    Then enter

    Code:
    ~/Desktop/keygen_osx
    to execute it.
     
  11. calderone macrumors 68040

    calderone

    Joined:
    Aug 28, 2009
    Location:
    Seattle
    #11
    What relevance could this possibly have to the OPs question?
     
  12. Juventino thread starter macrumors member

    Joined:
    Jun 26, 2010
    Location:
    Tehran
    #12
    nah, it's not about mistyping.look at this :

    test account :

    Code:
    Last login: Sun Feb 13 02:06:46 on console
    Amins-MacBook:~ test$ chmod u+x/Users/test/Desktop/keygen_osx 
    usage:	chmod [-fhv] [-R [-H | -L | -P]] [-a | +a | =a  [i][# [ n]]] mode|entry file ...
    	chmod [-fhv] [-R [-H | -L | -P]] [-E | -C | -N | -i | -I] file ...
    Amins-MacBook:~ test$ /Users/test/Desktop/keygen_osx 
                 .
                 :
                 |
           ______|____
          _\          /
          \        ___\
    - ---- \_      __\__--- -  [ e ]  m  b  r  a  c  e -- - --- ----- --------
           /           /
          /____________\
                 |                                  ... try E once ...
                 |
                 :                               ... and your addicted!
                 .
    
    Arobas Guitar Pro 6 Keymaker
    Enter your offline activation request code:
    
    my current account :

    Code:
    Last login: Sat Feb 12 17:24:09 on ttys000
    Amins-MacBook:~ Amin$ chmod u+x/Users/Amin/Desktop/keygen_osx 
    usage:	chmod [-fhv] [-R [-H | -L | -P]] [-a | +a | =a  [i][# [ n]]] mode|entry file ...
    	chmod [-fhv] [-R [-H | -L | -P]] [-E | -C | -N | -i | -I] file ...
    Amins-MacBook:~ Amin$ /Users/Amin/Desktop/keygen_osx 
    -bash: /Users/Amin/Desktop/keygen_osx: Permission denied
    
    I typed the same thing in both.

    ---

    The chmod 755 command worked! thank you LPZ for your time.
    as I know chmod 755 means read and execute access for everyone and also write access for the owner of the file.
    according to the last log I posted I already had read/write access.
    I still don't know what the problem was!
     
  13. server.downz macrumors newbie

    Joined:
    Nov 9, 2016
    #13
    Hi guys,

    I've got this issue when I tried to run the keygen_osx file.

    Last login: Thu Nov 10 12:12:39 on ttys000

    Joes-MacBook-Pro:~ Joe$ /Users/Joe/Desktop/keygen_osx ; exit;

    Segmentation fault: 11

    logout

    Saving session...

    ...copying shared history...

    ...saving history...truncating history files...

    ...completed.


    [Process completed]


    So... How to solve it? Can anybody here suggest me a solution?

    TQ in advanced
     
  14. MC6800 macrumors 6502

    Joined:
    Jun 29, 2016
    #14
    You're actually getting a different error, a segmentation fault. It's usually due to running bad code, such as the wrong binary type or a mismatched library file. How sure are you of this keygen_osx file?
     

Share This Page