Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rema

macrumors regular
Original poster
Sep 16, 2006
163
0
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:

To do this, run up Terminal and follow the quick step by step below:

sudo su (enter your password)
cp /etc/hosts /etc/hosts.bak
echo 65.54.239.20 messenger.hotmail.com >> /etc/hosts
echo 65.54.179.216 nexus.passport.com >> /etc/hosts
echo 65.54.183.203 login.live.com >> /etc/hosts
exit

but i not sure what i'm doing :(
can someone give me a step by step
 
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. :)
 
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).
 
thanks for getting back to me guys,

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

Last login: Thu Jan 31 22:20:03 on ttys000
anthony-computer:~ Anthony$

i then type in sudo su superfish and its says this

Last login: Thu Jan 31 22:21:51 on ttys000
anthony-computer:~ Anthony$ sudo su superfish
su: unknown login: superfish
anthony-computer:~ Anthony$ sudo su superfish

then when i try it again its says

Last login: Thu Jan 31 22:21:51 on ttys000
anthony-computer:~ Anthony$ sudo su superfish
su: unknown login: superfish
anthony-computer:~ Anthony$ sudo su superfish
su: unknown login: superfish
anthony-computer:~ Anthony$

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)
 
sudo su (enter)

then type your password. adding any other criteria afterword tries to sudo as the 'username' after the binary name.
 
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.
 
midflux thanks for info but that didnt seem to work i entered in my password and its game me same message

Last login: Thu Jan 31 23:27:31 on console
anthony-computer:~ Anthony$ sudo su enter
Password:
su: unknown login: enter
anthony-computer:~ Anthony$ sudo su enter
su: unknown login: enter
anthony-computer:~ Anthony$

LinuXtreme i only have one account on my compuer how can i log into the privileged account
 
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:

sudo su Anthony
enter
password: whatever it is
enter
 
this is what i get when i try that

Last login: Thu Jan 31 23:39:08 on ttys000
anthony-computer:~ Anthony$ sudo su anthony
bash-3.2$ superfish
bash: superfish: command not found
bash-3.2$
 
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>
 
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).
 
Look at the user account properties (in control panel > Accounts) and see if your account is set up as a system administrator or standard.

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]

Seems like I remember that this has to be done before using sudo, Can anyone confirm?

No, root does not need to be enabled to use sudo.



And finally.. if your password is superfish, please change it. ;)
 
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


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.

*: It would be:
Code:
sudo -s
<enter admin password>
OR
Code:
su - 
<enter root password>


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.
 
sudo su puts you in super user mode, it works just fine.

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..

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.

Without root enabled, no you cannot.
 
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.


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.
 
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.

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?
 
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:
 
If you want to argue it that way, sudo -s isn't either ;) once upon a time all you had was su.

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.

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

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.
 
sorry guys im getting a bit confused :confused:

ive tried all thos combinations no joy

su -

Last login: Fri Feb 1 00:33:25 on ttys000
anthony-computer:~ Anthony$ su -
Password:
su: Sorry
anthony-computer:~ Anthony$

sudo -s
Last login: Fri Feb 1 00:35:00 on ttys002
anthony-computer:~ Anthony$ sudo -s
bash-3.2#

sudo su
Last login: Fri Feb 1 00:35:06 on ttys002
anthony-computer:~ Anthony$ sudo su
sh-3.2#
 
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:)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.