# Switching between users in the Terminal?



## StarBuck (Jul 23, 2004)

Hi I'm trying to switch to the cyrus user in the terminal but when I type in 
login it ask for a password for the cyrus user.  

It wont except my admin password.

I need to change to the cyrus user in the terminal to repair a mail server problem, any ideas anyone?

Ta


----------



## nixgeek (Jul 24, 2004)

If you do a "su cyrus", you have to supply the password for the user you want to "su" as (in this case, "cyrus").


----------



## StarBuck (Jul 24, 2004)

If I type su cyrus it ask for my password it won't except my admin password, I have also tried typing cyrus for the password.


----------



## nixgeek (Jul 24, 2004)

Do you know the password for cyrus?  If not, just reset it.

I hope you didn't think I meant to type "cyrus" as the password.  Type the password for the user "cyrus" after you type "su cyrus".  Remember that when you use "su" to become another user, it's as if you login as that particular user, so you have to supply the password for whatever user you are "su"-ing as at the "Password:" prompt.


----------



## StarBuck (Jul 24, 2004)

nixgeek said:
			
		

> Do you know the password for cyrus?  If not, just reset it.
> 
> I hope you didn't think I meant to type "cyrus" as the password.  Type the password for the user "cyrus" after you type "su cyrus".  Remember that when you use "su" to become another user, it's as if you login as that particular user, so you have to supply the password for whatever user you are "su"-ing as at the "Password:" prompt.



Thanks for replying to my posts first.

What i'm trying to do is switch users in the terminal, but when I do this it asks me for the cyrus password which I don't know.  

How can I change the password for cyrus? 

su allows you to switch users how is this different to login?

Ta


----------



## nixgeek (Jul 24, 2004)

You should be able to switch the password for "cyrus" under System Preferences if you select the User Accounts option.

If you want to change the password of "cyrus" from Terminal, you have to type "passwd cyrus" and then you will be prompted for a new password for the user named "cyrus."  Of course, the account with which you are logged in should have the sufficient permissions to change the passwords of other user accounts.

As for "su," the reason it's different than a regular login is that it doesn't require you to log out nad log back in as another user.  It allows you to become another user temporarily for as long as you need it.  It's mostly used when one needs to use the root account momentarily for tasks that require root-level access.  Once you are done with the account you "su"-ed to, you can exit by simply typing "exit" and it will bring you back to your user account.


----------



## StarBuck (Jul 24, 2004)

Thanks


----------

