Ubuntu 12.04 - Add User with Corresponding Home Directory

If you want to add a user to your ubuntu system with a corresponding home folder (such as for FTP etc), then run the following commands/script.
USERNAME="enter-your-username-here"
sudo useradd -d /home/$USERNAME -m $USERNAME
sudo passwd $USERNAME

Change Default User Shell

If you want to default to a bash terminal by default when you log in as the user, then you will need to update the passwd file.

sudo $EDITOR /etc/passwd

Find the user you just added (it should be the last line because you just addeed it) and change the path after the last : to be /bin/bash instead of /bin/sh

No comments:

Post a Comment