I am currently:


I wish to change to:


How does one do this. I tried: su sensu but nothing happens.

  • 1
    Possible duplicate of - askubuntu.com/a/489937/119531
    – Raphael
    Dec 9, 2015 at 18:19
  • 1
    @Raphael Not possible duplicate. I logged in as root, Exit will not work as I will log out of the server. Think. Dec 9, 2015 at 18:21
  • 2
    su - sensu should work. However try also sudo -iu sensu
    – kos
    Dec 9, 2015 at 18:40
  • What's the output of getent passwd sensu?
    – muru
    Dec 9, 2015 at 19:15

1 Answer 1


You should use su:

su [-|-l|--login] USERNAME

If you specify the login option (either -, or -l, or --login: all are synonyms), you will get an environment similar to if you directly logged in as that user. Otherwise you stay in the current environment (e.g. many env variables, the current directory, etc).

Example: (note the usernames and current working directories!)

root@wolf-pack:~# su bytecommander
bytecommander@wolf-pack:/root$ exit

root@wolf-pack:~# su - bytecommander
bytecommander@wolf-pack:~$ exit


PS: If you run su not as root, you will of course be prompted for the password of the user as who you want to log in.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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