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?
It's all written in the manual page!
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:
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:
and:
For those wondering what gecos actually is, wikipedia defines it as follows:
--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 asgit
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 viagit
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 thefinger
command so they can get more information about him/her/it. You can also set it separately with thechfn
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: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!