quick help using terminal

Discussion in 'Mac Basics and Help' started by rema, Jan 31, 2008.

  1. rema macrumors regular

    Joined:
    Sep 16, 2006
    #1
    hey guys trying to fix a problem with adium using terminal but am clueless on how to use it

    this is what i am meant to do:

    but i not sure what i'm doing :(
    can someone give me a step by step
     
  2. rema thread starter macrumors regular

    Joined:
    Sep 16, 2006
  3. Osarkon macrumors 68020

    Osarkon

    Joined:
    Aug 30, 2006
    Location:
    Wales
    #3
    Ah okay.

    Firstly get Terminal open (spotlight it if you don't know where it is, can't remember off the top of my head).

    After that's up, enter 'sudo su (then your user password)' <-- without the quotation marks or brackets

    Then just copy and paste the lines into terminal afterwards one-by-one, pressing enter after each one.

    That should get you done. :)
     
  4. yeroen macrumors 6502a

    yeroen

    Joined:
    Mar 8, 2007
    Location:
    Cambridge, MA
    #4
    Open up Terminal.app (in /Applications/Utilities). Type in

    sudo su

    This will prompt you for your password. Once authenticated, you are now the 'root' superuser (i.e. almighty God), so you now have write permission the /etc/hosts file. Then cut and paste those lines one by one into the terminal.

    What it's doing is backing up the original hosts file to hosts.bak, and appending the hosts file with the hostnames and IP addresses of messenger.hotmail.com, etc. This is so it doesn't have to look these up through DNS.

    An alternative way to do this is, in Finder, copy /etc/hosts to a new file: /etc/hosts.bak, then with your favorite text editor (Text Edit say), cut and paste those lines at the end of the /etc/hosts file (you will be prompted for a password for write permission).
     
  5. rema thread starter macrumors regular

    Joined:
    Sep 16, 2006
    #5
    thanks for getting back to me guys,

    ok this is whats happening i open terminal
    the box pops up and say

    i then type in sudo su superfish and its says this

    then when i try it again its says

    not sure what i am doing wrong

    (i changed the computer name and password in the qoutes wasnt sure if someone could hack my mac or something)
     
  6. Mindflux macrumors 68000

    Mindflux

    Joined:
    Oct 20, 2007
    Location:
    Austin
    #6
    sudo su (enter)

    then type your password. adding any other criteria afterword tries to sudo as the 'username' after the binary name.
     
  7. LinuXtreme macrumors regular

    LinuXtreme

    Joined:
    Jul 15, 2007
    Location:
    Near Aspen
    #7
    I've gotten the same message as well. I quickly realized that I had to log into a privileged account (one with administrator privileges as opposed to my day-to-day normal user account). Give that a try.
     
  8. rema thread starter macrumors regular

    Joined:
    Sep 16, 2006
    #8
    midflux thanks for info but that didnt seem to work i entered in my password and its game me same message

    LinuXtreme i only have one account on my compuer how can i log into the privileged account
     
  9. Osarkon macrumors 68020

    Osarkon

    Joined:
    Aug 30, 2006
    Location:
    Wales
    #9
    Wait a minute...

    Surely on the first line, you wouldn't put your password, you'd put your username.

    Then press enter and when it prompts for the password, then you give it.

    Try that out, it works for me. I think the original instructions were a bit wrong.

    Thought it looked odd..

    So it would be:

     
  10. rema thread starter macrumors regular

    Joined:
    Sep 16, 2006
    #10
    this is what i get when i try that

     
  11. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #11
    Just whom are you trying to su to? Root? That's not how to do it*.
    Anyway.. why switch to root? Why not just use sudo for what (unix)god intended it for?


    Code:
    sudo cp /etc/hosts /etc/hosts.bak
    sudo echo 65.54.239.20 messenger.hotmail.com >> /etc/hosts
    sudo echo 65.54.179.216 nexus.passport.com >> /etc/hosts
    sudo echo 65.54.183.203 login.live.com >> /etc/hosts


    *: It would be:
    Code:
    sudo -s
    <enter admin password>
    OR
    Code:
    su - 
    <enter root password>
     
  12. LinuXtreme macrumors regular

    LinuXtreme

    Joined:
    Jul 15, 2007
    Location:
    Near Aspen
    #12
    Look at the user account properties (in control panel > Accounts) and see if your account is set up as a system administrator or standard.

    Given that you have just one user account, I'd imagine that you're set up as Administrator already though.

    The other possibility is that you've not set up the root account yet (Seems like I remember that this has to be done before using sudo, Can anyone confirm?). Sorry I can't help with setting that up (I'm not on my Mac right now so I'm doing this off the top of my head).
     
  13. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #13
    Or just type in "id" in the Terminal. See yourself as part of Group 80? Yes, admin. No, not admin.

    Code:
    null:~ yellow$ id
    uid=501(yellow) gid=501(yellow) groups=501(yellow), 81(appserveradm), 79(appserverusr), [B]80(admin)[/B]
    No, root does not need to be enabled to use sudo.



    And finally.. if your password is superfish, please change it. ;)
     
  14. Mindflux macrumors 68000

    Mindflux

    Joined:
    Oct 20, 2007
    Location:
    Austin
    #14

    you are taking this way too literally I think.

    type: sudo su
    press the enter key
    it'll ask for a password, use your admin password

    you are now in super user mode, do your commands and exit the terminal.


    sudo su puts you in super user mode, it works just fine.

    I cannot issue "su -" and get a password to work. I guess I don't have root enabled on my machine, 'sudo su' however gets me there just fine.
     
  15. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #15
    Folks, su does not equal root. The command su means substitute user, not "superuser". With no argument, it assumes you want to su to root. But since you're using sudo (which means "do as sub'd user") with no argument it means "do as root".

    So,

    sudo su effectively means: "do as root switch to root", which is pointless, since all the commands above can be done simply by adding sudo before them, meaning, do the following command as root.

    But if you really need to do this, just use the -s flag.

    Code:
    sudo -s
    Enter your admin password.

    You're now logged in as root.

    Anyway..

    Without root enabled, no you cannot.
     
  16. Mindflux macrumors 68000

    Mindflux

    Joined:
    Oct 20, 2007
    Location:
    Austin
    #16

    pointless? it's a keystroke saver. Once you do sudo su you are in a 'super user' shell. As if I just did su -. And yes yes, sudo -s does the same thing, whatever. Semantics.
     
  17. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #17
    Then do sudo -s.

    sudo su is not the "proper" way to do it. Besides, root commands are not logged anywhere. Using sudo, all commands are logged to the syslog.

    For security purposes, particularly when one doesn't know what they are doing (which the original poster clearly does not), stick with the safe method, ya?
     
  18. Mindflux macrumors 68000

    Mindflux

    Joined:
    Oct 20, 2007
    Location:
    Austin
    #18
    If you want to argue it that way, sudo -s isn't either ;) once upon a time all you had was su.
     
  19. Osarkon macrumors 68020

    Osarkon

    Joined:
    Aug 30, 2006
    Location:
    Wales
    #19
    I get the distinct impression yellow has more of a clue about unix than the rest of us at the moment. Or at least makes it look like that. ;)

    But it seems this thread has gotten rather complicated for such a simple thing :confused:

    To the OP:

    Once you got to the stage where it said bash-3.2$ on the command line, instead of putting in a password, just try inputting the commands.

    All these instructions are getting confusing...though it is rather late at night. :eek:
     
  20. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #20
    Yes.. su for substitute user. With no argument, it assumed you want to sub to root. That is still possible. Assuming one has root enabled on their Mac. Which is not necessary, nor advised if one doesn't know what they are doing.

    Just do this. You'll only be asked for your admin password the first time, the rest of the commands will (should!) fall within your 5 minute alloted timeout for sudo'd authentication.
     
  21. rema thread starter macrumors regular

    Joined:
    Sep 16, 2006
    #21
    sorry guys im getting a bit confused :confused:

    ive tried all thos combinations no joy

    su -

    sudo -s
    sudo su
     
  22. Mindflux macrumors 68000

    Mindflux

    Joined:
    Oct 20, 2007
    Location:
    Austin
    #22
    both of those seem to have worked. your prompt changed.
     
  23. rema thread starter macrumors regular

    Joined:
    Sep 16, 2006
    #23
    big thanks guys i read what you posted carefully i saw the bit about bash-3.2#

    thanks again guys and adium seems to be working no but msn or connection is abit unstable at moment

    once again big thanks ;););):D:)
     
  24. jeffmc macrumors 6502

    Joined:
    Sep 21, 2007
  25. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #25
    LOL. :D I <3 U.
     

Share This Page