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 added a new linux user by doing a

useradd -d /var/www/ -m newuser
passwd newuser

I tested the account by logging into the server with the following command


After login, the shell doesn't let me do tab autocomplete. For example, I would type /var/www/myweb{tab}, but the tab button only enters a space into the shell. Also, pressing the up and down arrow keys does not give me the most recent shell commands entered.

Everything works perfectly when I ssh login as root. But it doesn't work when I ssh login as newuser.

Did I miss something?


share|improve this question
up vote 19 down vote accepted

Check what shell 'newuser' is using. Make sure it's one that actually supports tab completion (like bash or zsh).

You can determine what shell the user is using using the following command

# getent passwd rodjek

You can change the users shell using the chsh command

# chsh -s /bin/bash rodjek
share|improve this answer
great, that worked! – John Jan 5 '10 at 21:38

On my system tab autocompletion is added by:

if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion

in .bashrc. Bashrc doesn't get created for new users since it doesn't exist in /etc/skel. Create .bashrc in /etc/skel with the above code in and it will work for new users. Then copy the file to the new user you just created so it works for them too.

share|improve this answer

have you checked your new user has the same shell as your root user? Its seems that your root user has bash your something like it and your new user has a ksh or something similar. Take a look at the /etc/passwd file or the SHELL environment variable.

share|improve this answer

Did the folder /var/www/ exist before you created the account?

Can you check that contents of /etc/skel get copied over to the home directory /var/www/

Did the new account get a different shell which doesn't support auto-complete?

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.