Posts Tagged ‘useradd’

Ubuntu – Add existing user to existing group

January 12, 2012 Leave a comment

To add an existing user to an existing group just type:

$ sudo usermod -a -G existing_group existing_user

This is explained in this nice post, among other uses of useradd and usermod:

Categories: linux, ubuntu Tags: , , ,

Change default shell in ubuntu

January 12, 2012 Leave a comment

After creating an account using command line in Ubuntu 11.10, the default shell for that user is /bin/sh:

$ sudo useradd -d /home/new_user -m new_user

To change the default shell, you have two ways:

1. Change the entry in /etc/passwd: the last field is the default shell, just change it to /bin/bash

$ sudo grep new_user /etc/passwd

2. Use the change shell command (chsh), you’ll be prompted for your password, and then type the new shell (/bin/bash):

$ chsh

Enter the new value, or press ENTER for the default
Login Shell [/bin/sh]: