Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I build my webapp on a local machine, but from time to time I can go to a public Linux server on which I have two accounts using a ssh connection (with putty). My accounts are two Linux users, access to my public webapp is at the address: 'http://linux_srver_ip/~user_name'.

Using putty, when I'm logged as user_one, how can I switch to user_two account?

share|improve this question
Does user_one has sudo permission? – quanta Aug 29 '11 at 8:16
how can I find that? – dole doug Aug 29 '11 at 8:30
Run a command with sudo, e.g: sudo /usr/sbin/visudo. – quanta Aug 29 '11 at 8:35
You don't need sudo if you have the password for the second account. To see what sudo privs a user has, run "sudo -l" to list them. – cjc Aug 29 '11 at 11:02

su <username>

share|improve this answer
I prefer "su - username". The "-" causes "su" to invoke the login shell process, which may be important if the other user should be accessed with a different environment from the first user's. – cjc Aug 29 '11 at 11:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.