Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

Last night, on my server, I did:

sudo su - mysql 

to change to the mysql user so I could run the mysql client, which is set up so it will only authenticate from the mysql account. I successfully ran the mysql client and made the change to the database. Nothing changed on the server overnight.

Today, nothing I try will allow my to change to the mysql user. It appears to succeed, given the message about no home directory, but whoami still reports my user id and trying to run mysql still fails.

wade@snoopy:~$ sudo su - mysql
[sudo] password for wade: 
No directory, logging in with HOME=/
wade@snoopy:~$ whoami

wade@snoopy:~$ sudo su mysql
wade@snoopy:~$ whoami

wwilliam@snoopy:~$ sudo -s
root@snoopy:/home/wade# su mysql
root@snoopy:/home/wade# whoami

/etc/passwd for mysql:

mysql:x:110:119:MySQL Server,,,:/nonexistent:/bin/false

Has anyone ever seen behavior like this?

share|improve this question
up vote 15 down vote accepted

su invokes the other user's login shell as given in /etc/passwd. In your case that's /bin/false so you don't get any interactive shell.


sudo -u test /bin/bash


sudo -u test /usr/bin/mysql

or something like that instead.

share|improve this answer

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.