Sudo Command Problems

I tried to use the sudo command in my terminal. The first time i entered the command " sudo chmod a+x install-mac-linux.sh " ,it said the warning and then asked for a password. I tried to type in my password, but nothing would show up on the terminal, like my keyboard was out of batteries. I pressed enter and it asked for the password again and still nothing would show up.I repeated this like 10 times and now is says "chmod: install-mac-linux.sh: No such file or directory " So now I'm lost and would really appreciate some help
This is what it last said
Last login: Fri Jun 17 20:19:49 on console
Clay-Callans-iMac:~ Clay$ sudo chmod a+x install-mac-linux.sh
Password:
Sorry, try again.
Password:
chmod: install-mac-linux.sh: No such file or directory
Clay-Callans-iMac:~ Clay$ sudo chmod a+x install-mac-linux.sh
chmod: install-mac-linux.sh: No such file or directory
Clay-Callans-iMac:~ Clay$

Instead of typing the file's name, drag it from the Finder into the open Terminal window.
(58847)

Similar Messages

  • Applescript for running sudo commands in terminal

    I'm a newbie when it comes to Applescript and was wondering if someone could help with a basic request. I need to write a small script to do the following:
    1. Launch terminal
    2. Run the 'Sudo -s' command
    3. Enter the administrator password (in plain text)
    and then
    4. run some sudo commands like "sudo defaults write /Library/Preferences/com.apple.loginwindow HiddenUsersList -array-add administrator"
    I actually WANT the administrator password to be in the script in plain text even though I understand the security risks (I will literally be the only person to ever see the script). I've trawled forums all over but can't seem to find what I am looking for and cannot get it working by patching together the various commands I have found. Thanks in advance for any help you can give!
    Sean

    I've included two examples.  The preferred way & the hacker way.
    with administrator
    It is easier to diagnose problems with debug information. I suggest adding log statements to your script to see what is going on.  Here is an example.
        Author: rccharles
        For testing, run in the Script Editor.
          1) Click on the Event Log tab to see the output from the log statement
          2) Click on Run
        For running shell commands see:
        http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html
    on run
        -- Write a message into the event log.
        log "  --- Starting on " & ((current date) as string) & " --- "
        --  debug lines
        set unixDesktopPath to POSIX path of "/System/Library/User Template/"
        log "unixDesktopPath = " & unixDesktopPath
        set quotedUnixDesktopPath to quoted form of unixDesktopPath
        log "quoted form is " & quotedUnixDesktopPath
        try
            set fromUnix to do shell script "sudo ls -l  " & quotedUnixDesktopPath with administrator privileges
            display dialog "ls -l of " & quotedUnixDesktopPath & return & fromUnix
        on error errMsg
            log "ls -l error..." & errMsg
        end try
    end run
    This version has an inline password.
    Notice the echo 'password' |
    The single quotes are no accident.
    It is easier to diagnose problems with debug information. I suggest adding log statements to your script to see what is going on.  Here is an example.
        Author: rccharles
        For testing, run in the Script Editor.
          1) Click on the Event Log tab to see the output from the log statement
          2) Click on Run
        For running shell commands see:
        http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html
    on run
        -- Write a message into the event log.
        log "  --- Starting on " & ((current date) as string) & " --- "
        --  debug lines
        set unixDesktopPath to POSIX path of "/System/Library/User Template/"
        log "unixDesktopPath = " & unixDesktopPath
        set quotedUnixDesktopPath to quoted form of unixDesktopPath
        log "quoted form is " & quotedUnixDesktopPath
        try
            set fromUnix to do shell script "echo 'password' | sudo ls -l  " & quotedUnixDesktopPath
            display dialog "ls -l of " & quotedUnixDesktopPath & return & fromUnix
        on error errMsg
            log "ls -l error..." & errMsg
        end try
    end run

  • Isight not working anymore after a sudo command i put on terminal

    i have not been able to get the smc to work.. but i am almost positive what the problem is that sudo command killall for coremedia command i did..b ecause not my isight built in camera will not work for any application.// this has me freaking out.. please if anyone could guide me through whatever it takes to get this isight camera working that would be a life saver.. i do not believe that it is hard ware because it was working just fine that entire day until i did something in terminal trying to stop the coremedia processes not knowing what they were..

    Post the exact command you entered in terminal.
    You can copy and paste the single command from the output of:
    history

  • Error executing sudo command

    When I try to execute a sudo command I get the following message:
    "sudo: /etc/sudoers is mode 0644, should be 0440
    Segmentation fault"
    What does it mean?
    Thanks for all the help.

    When I try to execute a sudo command I get the following message:
    "sudo: /etc/sudoers is mode 0644, should be 0440
    Segmentation fault"
    What does it mean?
    It means someone has incorrectly modified the /etc/sudoers file, and as a side effect its permissions were changed to an insecure form, so sudo refuses to use the file. It is also possible that the /etc/sudoers file syntax is also invalid, which might also cause the segmentation fault.
    'visudo' should be used to edit the /etc/sudoers file, which would have properly preserved the permissions, as well as verified that the updated /etc/sudoers file contained valid syntax so that sudo would continue to work. See 'man visudo'.
    You now have a problem, in that you can no longer use sudo to fix the permissions.
    You should first try booting your installation DVD. Via the Menu, you can run Disk Utility and run Repair Permissions. Hopefully this will repair the /etc/sudoers file. You could try running Applications -> Utilities -> Disk Utility, however, if it wants to use sudo to elevate its privileges, that would fail, as a broken /etc/sudoers file is still a broken /etc/sudoers file.
    If you have by any chance enabled the 'root' account, you could try logging in as root and fixing the /etc/sudoers file's permissions.
    You should also run visudo, so that the file's syntax is valid.
    I think you can use the Installation DVD to enable the root account. that might be another way to login as root.
    If repair permissions does not work, then maybe you can put your Mac into firewire target mode, mount your Mac's disk on another Mac via firewire, and repair the /Volume/Macintosh HD/etc/sudoers permissions from the working Mac.
    If that failes, the next step is booting your Mac in Single User mode. Search for "Single User Mode" in the forums, and you should find instructions on both booting, as well as how to make the root file system writable so you can change the permissions from single user mode.
    And if that does not work, I think you are left with reinstalling the OS.
    Message was edited by: BobHarris

  • -bash: sudo: command not found

         Hello all,
    I have had WAY too many problems with this laptop, and at this point in its miserable little life, I've decided to just wipe the hard drive and start fresh, not caring at all what happens to the files left on there. As previously stated in one of my earlier questions (That was, might I add, never fully answered.), this late 2008 MacBook (aluminum) has a problem where it does not boot up, and just endlessly shows the gray spinning pinwheel. Four months later, that just stops, and now when trying to boot up with my normal startup disk, it brings me right to the Recovery disk and tries to reinstall OS X. I tried, it failed 5 minutes in. So I tried to wipe the hard drive, and it says:  Disk Erase failed with the error: Couldn't unmount disk.   I looked it up and I saw that if I went into the Terminal and typed: sudo diskutil unmountDisk /dev/disk0 , it would unmount the disk. But whenever I type that, it says: -bash: sudo: command not found. I have no idea how to fix this, and I would really like to be able to use my laptop again without giving somebody my money to do it for me.
                                                 Thanks,
                                                      Luke

    Clean Install of Snow Leopard
    Be sure to make a backup first because the following procedure will erase
    the drive and everything on it.
         1. Boot the computer using the Snow Leopard Installer Disc or the Disc 1 that came
             with your computer.  Insert the disc into the optical drive and restart the computer.
             After the chime press and hold down the  "C" key.  Release the key when you see
             a small spinning gear appear below the dark gray Apple logo.
         2. After the installer loads select your language and click on the Continue
             button. When the menu bar appears select Disk Utility from the Utilities menu.
             After DU loads select the hard drive entry from the left side list (mfgr.'s ID and drive
             size.)  Click on the Partition tab in the DU main window.  Set the number of
             partitions to one (1) from the Partitions drop down menu, click on Options button
             and select GUID, click on OK, then set the format type to MacOS Extended
             (Journaled, if supported), then click on the Apply button.
         3. When the formatting has completed quit DU and return to the installer.  Proceed
             with the OS X installation and follow the directions included with the installer.
         4. When the installation has completed your computer will Restart into the Setup
             Assistant. After you finish Setup Assistant will complete the installation after which
             you will be running a fresh install of OS X.  You can now begin the update process
             by opening Software Update and installing all recommended updates to bring your
             installation current.
    Download and install Mac OS X 10.6.8 Update Combo v1.1. You may then open App Store, click on the Purchases icon in the toolbar, and re-download any OS X upgrade you purchased except Mavericks. Since Yosemite has been released the App Store may not let you re-download Mavericks, but it will let you download Yosemite.

  • PLEASE HELP making a program that uses sudo commands

    hey
    is there anyway to make a program run sudo commands
    i have a problem because in a terminal it would ask you to input a password.
    is there a way to use a fake keyboard program to input the password in the back ground
    of my java application or some how run sudo commands? my application relies on some outputs of these commands.
    please help thanks.

    ill tell you a bit about my program im making.
    i have a wireless usb that i have to switch back and forth to get my paticullar drivers to
    do certain things e.g. one is for web browsing and the other one has packet injection.
    by typing sudo modprobe ect.. i can switch through a terminal. which requires me to type in a password.
    iv made a application which uses the
    Runtime.getRuntime().exec("sudo ...."); it has 2 buttons to switch from diffrent drivers and always runs at start up.
    just a big problem i cant use sudo it just freezes when i start and click on the buttons. and doesnt ask me for a password.
    can anyone help thanks

  • What is sudo command for? can I undo sudo commands?

    what is sudo command for? can I undo sudo commands?

    Niel wrote:
    If a dialog box appears that asks for your password, ask yourself whether you're doing anything that requires it, such as logging in, using sudo, moving or copying items in some system-level folders, or installing software. Mistyping a command may delete files that should remain intact, or damaging the Mac OS X installation by moving files around or altering permissions on certain components.
    (30169)
    Is there any way that I could know that those problems are occuring>>> i'm referring to "moving files" and altering permissions on certain components?
    and when you say altering permissions? what do you mean by that?
    is there anyway that I can fix it? or buy a certain software for mac that would fix the system problems? like in windows there are Norton system work
    I was wondering I copy and paste the said command to my terminal but it didn't work. Do you know what would happen to my system if I messed up with that command? >>>im referring to this command http://docs.info.apple.com/article.html?artnum=307354
    Message was edited by: Mac Ken

  • What do the following SUDO-Commands mean and do?

    Hey Everybody,
    I did google these two commands but I cannot find a straight answer which is understandable for me. Can someone please explain to me in plain English what they do?
    1. "sudo chmod -RN ~"
    2. "sudo chown -R `id -un` ~"
    My second question is: After I have executed these 2 commands, will there be a problem or danger to my system if I won't boot up off the Leopard DVD and click the "Reset" button in the "Reset Home Directory Permissions and ACLs" section? Because this reset seems not possible on my machine.
    Thank you very much for your answers!
    AirMcEnroe

    I'll start off by asking if you have a problem that you are trying to solve, or if you are just having fun with Google? The sudo command is a very dangerous command, and using the -R option allows the computer to multiply your mistakes with amazing speed.
    I did google these two commands but I cannot find a straight answer which is understandable for me. Can someone please explain to me in plain English what they do?
    1. "sudo chmod -RN ~"
    sudo says run the following command as if you were the super user (the all powerful). It will prompt for your password (assuming you are an 'admin' user). You will see nothing while typing the password.
    chmod is used to change file permissions (see "man chmod").
    The tilda ~ says start with your home directory.
    -R says recursively process every file and directory under the specified starting directory (in this case you specified ~ your home directory).
    -N says remove any Access Control Lists (ACL) found.
    Not sure why you want to do this. It seems like a very big hammer and some of those ACLs may be service a valuable function, such as protecting you from shooting yourself in the foot, or enabling specific needed permissions on newly created files, etc...
    And if you happen to fumble finger entering the starting directory ~, you could destroy ACLs outside of your home directory tree and destroy critical OS ACLs.
    Make sure you have a very good full system backup before you take aim at your foot.
    2. "sudo chown -R `id -un` ~"
    chown changes the ownership of files and directories.
    -R says recursively process every file and directory under the specified starting directory (in this case you specified ~ your home directory).
    `id -un` obtains your short username, the `...` says substitute the output from id -un onto the chown command line.
    So this command is going to walk your home directory tree and change the ownership of every file and directory it finds and force you to be the owner.
    Again a very big hammer, and one that if you specify the wrong starting directory will turn your Mac into a paper weight. Make sure you have a very good full backup before you start.
    My second question is: After I have executed these 2 commands, will there be a problem or danger to my system if I won't boot up off the Leopard DVD and click the "Reset" button in the "Reset Home Directory Permissions and ACLs" section? Because this reset seems not possible on my machine.
    By the way, Terminal, Unix, X11, and command line command, ssh, rsync, etc... questions are best asked in the Mac OS X Technologies > Unix Forum
    <http://discussions.apple.com/forum.jspa?forumID=735>

  • HT4103 my sudo command is not working

    Hello, when i type sudo it show bellow message
    Arifur-Rahmans-MacBook-Pro:~ arif$ sudo
    -bash: sudo: command not found
    when i type ls
    Arifur-Rahmans-MacBook-Pro:~ arif$ ls
    -bash: ls: command not found
    Please help me i am not able to work anythings.

    When I said type
    echo $PATH
    I did mean PATH in ALL CAPITALS.  When working on the Unix side of Mac OS X, as weill all Unix systems upper and lower case do matter.
    But from the error message, I can see that somewhere along the way, mongodb (a database package), and the modification of PATH was done incorrectly.
    If you installed MongoDB, AND if the instructions had to modify your .profile (or perhaps .bash_profile), then either their instructions were wrong, or you missed a step, which explains why you can not enter commands are not found
    PATH is a Unix environment variable that contains a colon separate list of directories where the shell will look for commands when you enter them at the command prompt.
    So your choices are delete the offending .profile (or perhaps .bash_profile) and forget about MongoDB, or if you do need MongoDB, then fix your .profile (or .bash_profile) so it has a properly formed PATH environment variable.
    Fixing this would look like
    /bin/ls -a         # this will show you all the files starting with a period (dot) as in .profile or .bash_profile
    /usr/bin/nano .profile
    now in this text editor use the arrow keys, and the delete key to find and delete offending text, then type in the corrected text.  Nano gives you a menu at the botton of the editor with additional commands.  ^O (Control-O) writes out any changes you made.  ^X (Control-X) exits from Nano.
    You want your PATH variable to look like (REMEMBER UPPER/lowercase is IMPORTANT)  ALSO spaces or nospaces are important.
    export PATH="/usr/local/mongodb-osx-x86_64-1.8.2:$PATH"
    NOTICE there is a colon between the MongoDB directory path, and the $PATH.  The $PATH will append your existing PATH to the end of the new PATH environment variable you are setting up.  The entire PATH string is enclosed in double quotes.  ALSO NOTICE, there is only 1 space between export and PATH.  No spaces anywhere else in the line.
    Again, I used .profile as the most likely file name, HOWEVER, your shell will look for 1 of 3 different initialization files starting with
    .bash_profile
    .bash_login
    .profile
    If will use the first file it finds in the above order and stop looking as soon as it finds a match.  So it is important that you edit the correct file.  The
    /bin/ls -a
    command will tell you want leading period filenames exist in your home directory
    I'll also give you one word of caution.  When playing on the Unix side of Mac OS X, and following instructions you do not understand, it is generally wise to have a very recent full backup of your system.  There are some commands that can make your system unusable should you enter them blindly.
    Message was edited by: BobHarris

  • How to disable sudo command in Terminal

    How to disable sudo command in Terminal

    Bad idea.
    Only an Admin user can use sudo, so if you have users on your system that you do not want to use sudo, then do not give them an admin account, and do not give them the password for an admin account.

  • Sudo Command in Bash Script

    So I created a simple bash script to run on login.....
    one of the commands is the following:
    sudo "something something something"....
    One thing I haven't learned in my years of Unix is how do you get a bash script to run a sudo command without having to enter a password?  I know this is trival, but just a quick 'this is how you do it' would be cool.
    Thanks ahead of time on this really dumb question.

    There's a few ways to do this.  Here's two (pick the method you like):
    Method 1: Using "askpass".
    With this you always do sudo -A command.  The -A argument tells sudo to execute a command that echos the password to stdout.  That command is something you write.  For this explaination let's call the command pw and stick it /usr/local/bin.  So it's full pathname would be /usr/local/bin/pw.
    sudo -A can get the pathname to pw a number of ways.
    1. From the sudoers file.
    Use visudo to add the following line to the sudoers file:
    Defaults:ALL    askpass=/usr/local/bin/pw
    2. Using the SUDO_ASKPASS environment variable.
    export SUDO_ASKPASS=/usr/local/bin/pw
    This might work too (assuming SUDO_ASKPASS has been previously exported):
    SUDO_ASKPASS=/usr/local/bin/pw sudo -A command
    Method 2: Have sudo read the password from stdin
    echo -n password | sudo -S command
    The -S option tells sudo to read the password from stdin so echo pipes it in (without the ending newline).
    The only relatively secure scheme of these two methods is the askpass (-A) method.  At least with that method you have a chance of encrypting/hiding your password down in the command that echoes it to stdout.  The -S method would contain your password explicitly in a script somewhere unless you make other provisions to encrypt/hide it with that technique.

  • SQL Command problem in Application Express 3.2.0.00.27

    To Oracle Application Express Development Team,
    Yesterday I installed Oracle Application Express 3.2.0.00.27.
    While doing my r&d, I came across one problem in SQL Command.
    For example I wanted to run sql "select * from tab"
    When I checked "Autocommit" checkbox it worked fine.
    But when I unchecked the "Autocommit" checkbox it gave me following error:
    ORA-01003: no statement parsed
    Please check post
    http://www.oraclebrains.com/2009/03/sql-command-problem-in-application-express-3200027/ for more details.
    Cheers

    I can't find the log file (a good indication that something went wrong)
    Here's the transcript of the session...
    SQL> startup upgrade
    ORACLE instance started.
    Total System Global Area 599785472 bytes
    Fixed Size 1288820 bytes
    Variable Size 264242572 bytes
    Database Buffers 331350016 bytes
    Redo Buffers 2904064 bytes
    Database mounted.
    Database opened.
    SQL> @apxpatch.sql
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    Wrote file apxset.sql
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    SQL>
    SQL> @apxldimg.sql
    PL/SQL procedure successfully completed.
    Enter value for 1: C:\Documents and Settings\jtench\Desktop\My Downloads\Oracle\apex_3.2.1
    old 1: create directory APEX_IMAGES as '&1/apex/images'
    new 1: create directory APEX_IMAGES as 'C:\Documents and Settings\jtench\Desktop\My Downloads\Oracle\apex_3.2.1/apex/images'
    Directory created.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    Commit complete.
    timing for: Load Images
    Elapsed: 00:03:30.03
    Directory dropped.
    SQL>

  • Terminal doesn't understand sudo command

    I am installing MacPorts 1.7.0 from a .dmg file. Following, I set up the environment variables in the .profile file, and tried to use Terminal to update using the sudo port selfupdate command from Terminal.
    This is the result I got:
    -bash: sudo: command not found
    Why is this, and what can I do?

    I think the error refers to the command(s) following "sudo." Were you prompted for your password?
    No, that would be:
    sudo fred
    Password:
    sudo: fred: command not found
    But if the command bash is asked to execute is not found you get
    fred
    -bash: fred: command not found
    So I think he is not finding sudo.
    That makes me think that PATH has been messed up, because sudo is in /usr/bin/sudo which is always in PATH unless it has been messed up. Which makes me think that .profile was properly executed, and that is how PATH got messed up.
    So I would look very closely at .profile and make sure PATH is setup correctly. I would expect it to looks something like:
    export PATH="$PATH:/opt/local/bin"

  • I want to disable 'Spotlight' for repairing my disk "Macintosh HD" , but somehow the command 'sudo mdutil -a -i off' does not work in 'Terminal'. I get result as ' bash: sudo: command not found' .I am using OS 10.10.  Please help.

    I want to disable 'Spotlight' for repairing my disk "Macintosh HD" , but somehow the command 'sudo mdutil -a -i off' does not work in 'Terminal'. I get result as ' bash: sudo: command not found' .I am using OS 10.10.  Please help.

    It appears that you may not have a properly installed OS X system.
    You must be connected to the Internet to reinstall OS X.
    In the menu bar, choose Apple menu > Restart. Once your Mac restarts (and the gray screen appears), hold down the Command (⌘) and R keys.
    Select “Disk Utility,” and then click Continue.
    Select your startup disk from the list on the left, and then Repair Disk.
    After disk is repaired, select Reinstall OS X, then click Continue.
    Follow the onscreen instructions. In the pane where you select a disk, select your current OS X disk

  • How to undo a sudo command?

    I used the following sudo command " sudo rm -rf ~/ .Trash/"  because my trash can wouldn't empty.  Unfortunately this deleted everything on my computer.  Any way to undo this command?  Please help????

    Linc Davis wrote:
    I'm not sure what you mean, but if you gave those instructions, please don't do it again. There is absolutely no reason ever to run such a command, even if the syntax were correct. Also, make sure you test any advice you give on this site on your own computer, as required by the terms of use.
    I have given that command, but with the proper syntax, any number of times, with absoutely no adverse affects. When I do give that command, or any command with rm, I take great pains to emphasize that it absolutely must be copied and pasted in. And I triple and quadruple check the syntax before I post it. And then I make sure that the Jive formating hasn't screwed with it in any way after posting. Given certain situations, it can be very useful.

Maybe you are looking for

  • Fonts not showing up in third party applications

    Hello All- I am running OS 10.9.2 on Active Directory and I have 370 total fonts (Typefaces) installed. If I am logged into a local Admin account everything is fine but if I log in as an AD user then I am missing fonts in third party applications suc

  • Fast Refresh Materialized View - failure

    Okay, this issue currently has me stumped. I searched the world wide web and still cannot seem to identify the cause of this issue. Here is the scenario: I created a materialized view log for the source table (let's say table1) found at DB1. I then c

  • Changing iTunes Store accounts with Automatic Downloads

    I use my Mac Mini at home as my media server/HTPC, and contains my iTunes library.  I want to copy all my music to my MacBook Air for work, as my internet at work is too slow for iTunes Match to work effectively.  Therefore, I was going to set Automa

  • Need to split one large high-res video into sub-parts

    I have a very large high-res video (5760 x 3240) that I would like to split into 9 separate videos, each 1920 x 1080.  These would make up the content of a 3x3 video wall and would be 'stitched' back together by the media players driving the wall. I

  • Why it takes long time to establish Database Connection ???

    Can any one please have a look on the following code snippet and show me which mistake I'm doing so it take long time to connect to DB(more than 5 minutes !!!!) Thanx in advance ... try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Class.forName("o