Information Technology Reference
In-Depth Information
# Guest OS (Ubuntu 12.04)
# Command executed by vagrant user
$ cd /home/git/lorem.git
$ git log
This command should print the first revision by Peter.
How It Works
In this recipe you will work using three different accounts: vagrant , git , and
peter .
The first account, vagrant , is the administrator of your host. It initializes all the
repositories and sets the authorization rules.
The second user, git , is a dummy user. It doesn't allow you to open the ssh con-
nection. Its only purpose is to allow other developers to connect with the git repositor-
ies using git clone, fetch, and push commands. When a developer, for instance Peter,
issues a git command—such as $ git fetch —then Peter's git client will connect to
the server using this dummy git account and then will execute some commands using
git account privileges. For this to work, the administrator (vagrant user in our example)
will have to allow Peter to use the git account on the server. This will be done with the
authorized_keys file on the git account.
The last account, peter , is the account you will use to mock the work by someone
else. We will use the account on the virtual system but you can also use any other ac-
count on any other computers in your organization.
The first account, vagrant , is available by default. Two other accounts, git and
peter , are created manually with the $ sudo adduser command.
What does it mean that git is a dummy account? Thanks to the --shell /usr/
bin/git-shell option of:
$ sudo adduser --shell /usr/bin/git-shell --gecos Git git
the git account will use git-shell . If you try to open the ssh session to the git ac-
count with:
# Host OS (e.g., Windows, Linux, OS X)
$ ssh -p2222 git@localhost
Search WWH ::




Custom Search