Unix Help in Mac Terminal

Discussion in 'Mac Basics and Help' started by Tokyo Express, Feb 12, 2010.

  1. Tokyo Express macrumors newbie

    Joined:
    Feb 12, 2010
    #1
    I have tried to get into root user with su - added the password which in return fails with the following message.

    su: zsh: No such file or directory

    I have tried to ise the command su - /bin/bash to force it wo use the Bash shell with no luck !

    Any help / pointers would be much appreciated !
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
  3. Tokyo Express thread starter macrumors newbie

    Joined:
    Feb 12, 2010
    #3
    Hi,
    I have enabled the root used in fact i have disabled it and re stated the pass word.
     
  4. BlueRevolution macrumors 603

    BlueRevolution

    Joined:
    Jul 26, 2004
    Location:
    Montreal, QC
    #4
    Just use

    sudo su

    No need to have the root user enabled, you can use your normal admin password, and you still can run all of your commands as root without having to sudo every command.
     
  5. belvdr macrumors 603

    Joined:
    Aug 15, 2005
    #5
    Use this instead:
    Code:
    su -s /bin/bash -l
    Then change your shell.
     
  6. jlindley macrumors newbie

    Joined:
    Feb 11, 2010
    #6
    bash$ sudo su -
    .. enter YOUR password ..

    "su -" means to become root and the "sudo" before that is the part that allows you to become root. This is all assuming that the account you are using has 'sudo' privileges. Members in the 'admin' group have it by default.

    *You shouldn't have to 'enable' the root user..

    Once you are 'root' I would highly recommend changing the root password.

    bash# passwd
    .. enter new password ..
    .. confirm new password ..

    *The whole changing your shell is completely optional and not necessary.
     
  7. belvdr macrumors 603

    Joined:
    Aug 15, 2005
    #7
    That's not correct. The command sudo allows non-privileged users to run some or all privileged commands without ever becoming root. The command su allows you to become root.

    Now, if you do "sudo su -" or "su -", it is going to attempt to make you root. If the shell, normally specified in /etc/passwd but not sure where OS X does it these days, is incorrect, you'll get the error the OP specified. That's why specifying "-s" is important here.
     
  8. jlindley macrumors newbie

    Joined:
    Feb 11, 2010
    #8
    My fault! I just now read the "zsh: No such file or directory:
     
  9. Tokyo Express thread starter macrumors newbie

    Joined:
    Feb 12, 2010
    #9
    Fixed !

    Ok i have used the following.

    sudo bash
    sudo -H -i
    Entered the passwords
    chsh it showed as zsh
    chsh - s /bin/sh

    exit
    su -
    im in !
     
  10. belvdr macrumors 603

    Joined:
    Aug 15, 2005
    #10
    No problem. I had read your post before you edited and I agreed with what you said. :)
     
  11. BlueRevolution macrumors 603

    BlueRevolution

    Joined:
    Jul 26, 2004
    Location:
    Montreal, QC
    #11
    Try it yourself. sudo su works perfectly well out of the box. I know; I use it.
     
  12. belvdr macrumors 603

    Joined:
    Aug 15, 2005
    #12
    I know it does, but the definitions of what those utilities do was wrong. It is the way OS X is configured by default that allows "sudo su -" to work and "su -" to fail.
     

Share This Page