While setting up a new Ubuntu 8.04 Hardy web server recently, I came across an issue that I couldn’t seem to figure out. I finally found a solution after a grueling search. Hopfully this helps anyoneone with the same problem.
While logged in as the initial user (set up during installation), after adding a new user account using the “useradd” command, I was unable to access many of the features that I was used to with the command prompt such as tab completion, colored prompts, and history scrolling. Finally I came across a forum that solved my problem. I found that the issue was that I was using an unfamiliar shell which did not support these features. The shell that was used to using is the bourne again shell (bash shell), and by setting up a new user, the default shell was set to the sh shell.
To change the default shell, you need to edit the /etc/passwd file.
vi /etc/passwd
This file contains a list of system accounts, each on a separate line. You must have root privileges in order to modify this file. Each account has seven fields seperated by a “:” symbol. These fields are username, password, UID, GID, User ID Info, Home Directory, and Shell Path. The field that you need to pay attention to is the Shell Path. Locate your user account from this list and verify change the shell path to the following:
/bin/bash
After you are finished modifying this file, log in using the modified account and type the following to verify that bash is your default shell:
echo $SHELL
This should return the following line:
/bin/bash
Enjoy all the features of using the bash shell!
Place your comment