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

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.


--disabled-login, which is similar to --disabled-password, is used to create the user account without any password and to avoid prompting for it. This is to avoid any attempt to log in as git on your Git server. The reason for this is that you're not supposed to log in to it directly, you're supposed to interact with it via git commands only.

--gecos sets additional information about the user you're creating (and doesn't have anything particular with git to do). It's not in much use these days. If you set gecos values for an account, other users can read that information using the finger command so they can get more information about him/her/it. You can also set it separately with the chfn command. The --gecos switch is intended to be followed by five comma-separated values which serves as additional comments about the user. The values are:

  1. Full name
  2. Room number
  3. Work phone
  4. Home phone
  5. Other

You can leave out any value and skip the ends, for example --gecos 'Donald Trump,3' would work, as would 'Donald Trump,3,,,President'.

The main reasons why you're asked to use the --gecos option is, I guess, to avoid prompts for these values, they are just annoying and don't make much sense these days, and may actually be a security risk. Never put your personal data here!