I'm trying to change the useradd default shell, so when the next new user created its shell would be /usr/sbin/tcsh.

One way doing that is by running the following command :

useradd -D -s /usr/sbin/tcsh

Another way is by editing the /etc/default/useradd:


I was wondering what is the difference between the two options?

Thanks in advance

2 Answers 2


There is no effective difference. There are many ways of setting configuration. They both edit the SHELL variable in the /etc/default/useradd file.

Check the man page with:

$ man useradd

Then look for the -s argument.

One might be more convenient or easier to remember than the other for some users. Since you have already tested both, you can decide for yourself which is easier for you to remember or use.


In the man page for useradd the normal behaviour of the -s option is:

-s, --shell SHELL The name of the user's login shell. The default is to leave this field blank, which causes the system to select the default login shell specified by the SHELL variable in /etc/default/useradd, or an empty string by default.

The -s option when invoked with -D behaves as follows:

-s, --shell SHELL

The name of a new user's login shell.

This option sets the SHELL variable in /etc/default/useradd.

So both methods set the SHELL variable in the /etc/default/useradd file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .