usr/bin :permission denied

Discussion in 'macOS' started by Neb Cross, Oct 24, 2008.

  1. Neb Cross macrumors newbie

    Joined:
    Oct 24, 2008
    #1
    Hi Everyone :)

    I am new to these forums so i hope i have got the correct category for this question.

    anyway.....

    I have just installed Apache Tomcat on my Mac (Version 10.5.5) an i am trying to put a simple script in my /usr/bin folder.

    To do this i have been using this command in my terminal:
    cp File /../../../usr/bin

    but when i execute it, the terminal says :permission denied.

    I would really appreciate any help with this matter.

    Thanks,
    -Neb
     
  2. italiano40 macrumors 65816

    italiano40

    Joined:
    Oct 7, 2007
    Location:
    NY
    #2
    you should do a sudo command before that command
     
  3. Eidorian macrumors Penryn

    Eidorian

    Joined:
    Mar 23, 2005
    Location:
    Indianapolis
    #3
    That's going to need a sudo. And as always...

    Code:
     We trust you have received the usual lecture from the local System
     Administrator. It usually boils down to these three things:
    
        #1) Respect the privacy of others.
        #2) Think before you type.
        #3) With great power comes great responsibility.
    
     
  4. Neb Cross thread starter macrumors newbie

    Joined:
    Oct 24, 2008
  5. Neb Cross thread starter macrumors newbie

    Joined:
    Oct 24, 2008
    #5
    Hi again,

    I have now got the script in the /usr/bin folder

    but, now i have a slightly different problem. When i run the script i get the same error message:
    -bash: /usr/bin/tomcat: Permission denied

    This is the script that i have placed in the /usr/bin folder. To run the script i type tomcat start
    Code:
    #!/bin/bash
    
    case $1 in
      start)
        sh /Library/Tomcat/bin/startup.sh
      ;;
      stop)
        sh /Library/Tomcat/bin/shutdown.sh
      ;;
      restart)
        sh /Library/Tomcat/bin/shutdown.sh
        sh /Library/Tomcat/bin/startup.sh
      ;;
      *)
        echo "Usage: start|stop|restart"
      ;;
    esac
    
    exit 0 
    
    Again your help would be greatly appreciated :)

    Thanks,
    -Ben
     
  6. Neb Cross thread starter macrumors newbie

    Joined:
    Oct 24, 2008
  7. John Jacob macrumors 6502a

    John Jacob

    Joined:
    Feb 11, 2003
    Location:
    Columbia, MD
    #7
    You need to do a chmod on the script file to give it executable permissions. For example, chmod 755 /usr/bin/ScriptFile. You may need to add a sudo before the chmod command to get the permissions needed to change the permissions.
     
  8. Neb Cross thread starter macrumors newbie

    Joined:
    Oct 24, 2008

Share This Page