Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I use Debian 6 and the terminal. When I type su -l I get something like this:

root@mycomputer:

as prompt. When I type su -l someuser I get this prompt:

$

There, I cannot use TAB to autocomplete paths, the source command is not known etc. How can I get the "style" of the root for every user? Does this depend on the distinction between bash, shell?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Yes, it depends on which shell is used. By default, new user accounts have their shell set to /bin/sh, the Bourne shell, which does not support more advanced features such as line editing, completion, etc.

Use chsh to change the user's shell. For example,

chsh -s $(which bash) someuser

will change someuser's shell to bash. You must give the full path to -s, and that path should be listed in /etc/shells.

I don't know which one you are currently using for root, so run echo $SHELL to find out. (Alternatively, run getent passwd root; the shell will be the last (7th) field.)

share|improve this answer
    
Great, thank you! –  strauberry Jun 8 '11 at 7:44

Edit the user's .bashrc and enable bash completion or type . /etc/bash_completion.

share|improve this answer
    
does this enable the source command, too? I use the .profile files for all users... –  strauberry Jun 5 '11 at 18:00
    
source is a shell builtin. It doesn't need to be enabled. –  bahamat Jun 5 '11 at 18:11
1  
source is a bash-specific alias for the "." command. It might not exist on other shells, while . always works. –  grawity Jun 5 '11 at 19:21

Your Answer

 
discard

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.