Skip to content

Commit fd9f9de

Browse files
committed
chapter 4: numerous tweaks, rewordings and font changes
Just minor cleanup and clarification in all of Chapter 4. Signed-off-by: Robert P. J. Day <[email protected]>
1 parent 4f7b789 commit fd9f9de

6 files changed

+15
-15
lines changed

book/04-git-server/sections/generating-ssh-key.asc

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ config id_dsa.pub
1818
----
1919

2020
You're looking for a pair of files named something like `id_dsa` or `id_rsa` and a matching file with a `.pub` extension.
21-
The `.pub` file is your public key, and the other file is your private key.
21+
The `.pub` file is your public key, and the other file is the corresponding private key.
2222
If you don't have these files (or you don't even have a `.ssh` directory), you can create them by running a program called `ssh-keygen`, which is provided with the SSH package on Linux/Mac systems and comes with Git for Windows:
2323

2424
[source,console]

book/04-git-server/sections/git-daemon.asc

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ Also, check that the Git binary is indeed located at `/usr/bin/git` and change t
5252

5353
Finally, you'll run `systemctl enable git-daemon` to automatically start the service on boot, and can start and stop the service with, respectively, `systemctl start git-daemon` and `systemctl stop git-daemon`.
5454

55-
Until LTS 14.04, Ubuntu used upstart service unit configuration.
56-
Therefore, on Ubuntu <= 14.04 you can use an Upstart script.
55+
Up to and including LTS 14.04, Ubuntu used upstart service unit configuration.
56+
Therefore, on Ubuntu 14.04 or earlier, you can use an Upstart script.
5757
So, in the following file
5858

5959
[source,console]

book/04-git-server/sections/git-on-a-server.asc

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ We assume that if you have a server with which to do this, you already have an S
9090

9191
There are a few ways you can give access to everyone on your team.
9292
The first is to set up accounts for everybody, which is straightforward but can be cumbersome.
93-
You may not want to run `adduser` and set temporary passwords for every user.
93+
You may not want to run `adduser` (or the possible alternative `useradd`) and have to set temporary passwords for every new user.
9494

95-
A second method is to create a single 'git' user account on the machine, ask every user who is to have write access to send you an SSH public key, and add that key to the `~/.ssh/authorized_keys` file of that new account.
95+
A second method is to create a single 'git' user account on the machine, ask every user who is to have write access to send you an SSH public key, and add that key to the `~/.ssh/authorized_keys` file of that new 'git' account.
9696
At that point, everyone will be able to access that machine via the 'git' account.
9797
This doesn't affect the commit data in any way -- the SSH user you connect as doesn't affect the commits you've recorded.
9898

book/04-git-server/sections/protocols.asc

+3-3
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ If you want to allow anonymous read-only access to your projects and also want t
180180
==== The Git Protocol
181181

182182
(((protocols, git)))
183-
Next is the Git protocol.
183+
Finally, we have the Git protocol.
184184
This is a special daemon that comes packaged with Git; it listens on a dedicated port (9418) that provides a service similar to the SSH protocol, but with absolutely no authentication.
185-
In order for a repository to be served over the Git protocol, you must create a `git-daemon-export-ok` file -- the daemon won't serve a repository without that file in it -- but other than that there is no security.
185+
In order for a repository to be served over the Git protocol, you must create a `git-daemon-export-ok` file -- the daemon won't serve a repository without that file in it -- but, other than that, there is no security.
186186
Either the Git repository is available for everyone to clone, or it isn't.
187187
This means that there is generally no pushing over this protocol.
188188
You can enable push access but, given the lack of authentication, anyone on the internet who finds your project's URL could push to that project.
@@ -200,6 +200,6 @@ The downside of the Git protocol is the lack of authentication.
200200
It's generally undesirable for the Git protocol to be the only access to your project.
201201
Generally, you'll pair it with SSH or HTTPS access for the few developers who have push (write) access and have everyone else use `git://` for read-only access.
202202
It's also probably the most difficult protocol to set up.
203-
It must run its own daemon, which requires `xinetd` configuration or the like, which isn't always a walk in the park.
203+
It must run its own daemon, which requires `xinetd` or `systemd` configuration or the like, which isn't always a walk in the park.
204204
It also requires firewall access to port 9418, which isn't a standard port that corporate firewalls always allow.
205205
Behind big corporate firewalls, this obscure port is commonly blocked.

book/04-git-server/sections/setting-up-server.asc

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ We also assume you're running a standard Linux distribution like Ubuntu.
1010
A good deal of what is described here can be automated by using the `ssh-copy-id` command, rather than manually copying and installing public keys.
1111
====
1212

13-
First, you create a `git` user and a `.ssh` directory for that user.
13+
First, you create a `git` user account and a `.ssh` directory for that user.
1414

1515
[source,console]
1616
----
@@ -86,12 +86,12 @@ $ git push origin master
8686
With this method, you can quickly get a read/write Git server up and running for a handful of developers.
8787

8888
You should note that currently all these users can also log into the server and get a shell as the `git` user.
89-
If you want to restrict that, you will have to change the shell to something else in the `passwd` file.
89+
If you want to restrict that, you will have to change the shell to something else in the `/etc/passwd` file.
9090

91-
You can easily restrict the `git` user to only doing Git activities with a limited shell tool called `git-shell` that comes with Git.
92-
If you set this as your `git` user's login shell, then the `git` user can't have normal shell access to your server.
93-
To use this, specify `git-shell` instead of bash or csh for your user's login shell.
94-
To do so, you must first add `git-shell` to `/etc/shells` if it's not already there:
91+
You can easily restrict the `git` user account to only Git-related activities with a limited shell tool called `git-shell` that comes with Git.
92+
If you set this as the `git` user account's login shell, then that account can't have normal shell access to your server.
93+
To use this, specify `git-shell` instead of bash or csh for that account's login shell.
94+
To do so, you must first add the full pathname of the `git-shell` command to `/etc/shells` if it's not already there:
9595

9696
[source,console]
9797
----

ch04-git-on-the-server.asc

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Furthermore, you want your collaborators to be able to access the repository eve
99
Therefore, the preferred method for collaborating with someone is to set up an intermediate repository that you both have access to, and push to and pull from that.
1010

1111
Running a Git server is fairly straightforward.
12-
First, you choose which protocols you want your server to communicate with.
12+
First, you choose which protocols you want your server to support.
1313
The first section of this chapter will cover the available protocols and the pros and cons of each.
1414
The next sections will explain some typical setups using those protocols and how to get your server running with them.
1515
Last, we'll go over a few hosted options, if you don't mind hosting your code on someone else's server and don't want to go through the hassle of setting up and maintaining your own server.

0 commit comments

Comments
 (0)