Ubuntu – What do the `–disabled-login` and `–gecos` options of `adduser` command stand for

addusercommand line

Running Ubuntu 12.04, I setup a private git server and created a group called git some time ago. Now I am following a guide to install gitlab and when it came to adding a user to the git group and create it, I saw that I already had it.

The command is this:

sudo adduser --disabled-login --gecos 'GitLab' git

taken from Gitlab installation Tutorial.

I would like to understand that command correctly. For me I thought I add a user to a group like this:

adduser user group

So what do --disabled-login and --gecos stand for?

Best Answer

It's all written in the manual page!

enter image description here

You don't need to install something, to search on google or to have an internet connection. Just open your terminal and first of all you must to run the following command:

man adduser

to open the manual page for adduser command.

Then, in that manual page type: /--disabled-login followed by Enter then press repetitively n to find all occurrences containing --disabled-login. Do the same for --gecos.

With a little bit of luck you will find out that:

--disabled-login
          Do not run passwd to set the password.  The user won't be able 
          to use  her  account until the password is set.

and:

--gecos GECOS
          Set  the  gecos field for the new entry generated.  adduser will 
          not ask for finger information if this option is given.

For those wondering what gecos actually is, wikipedia defines it as follows:

The gecos field, or GECOS field is an entry in the /etc/passwd file on Unix, and similar operating systems. It is typically used to record general information about the account or its user(s) such as their real name and phone number.