You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/04-git-server/sections/setting-up-server.asc
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
Let's walk through setting up SSH access on the server side.
5
5
In this example, you'll use the `authorized_keys` method for authenticating your users.
6
6
We also assume you're running a standard Linux distribution like Ubuntu.
7
-
First, you create a 'git' user and a `.ssh` directory for that user.
7
+
First, you create a `git` user and a `.ssh` directory for that user.
8
8
9
9
[source,console]
10
10
----
@@ -52,7 +52,7 @@ Initialized empty Git repository in /opt/git/project.git/
52
52
53
53
Then, John, Josie, or Jessica can push the first version of their project into that repository by adding it as a remote and pushing up a branch.
54
54
Note that someone must shell onto the machine and create a bare repository every time you want to add a project.
55
-
Let's use `gitserver` as the hostname of the server on which you've set up your 'git' user and repository.
55
+
Let's use `gitserver` as the hostname of the server on which you've set up your `git` user and repository.
56
56
If you're running it internally, and you set up DNS for `gitserver` to point to that server, then you can use the commands pretty much as is (assuming that `myproject` is an existing project with files in it):
57
57
58
58
[source,console]
@@ -79,10 +79,10 @@ $ git push origin master
79
79
80
80
With this method, you can quickly get a read/write Git server up and running for a handful of developers.
81
81
82
-
You should note that currently all these users can also log into the server and get a shell as the ``git'' user. If you want to restrict that, you will have to change the shell to something else in the `passwd` file.
82
+
You should note that currently all these users can also log into the server and get a shell as the `git` user. If you want to restrict that, you will have to change the shell to something else in the `passwd` file.
83
83
84
-
You can easily restrict the 'git' user to only doing Git activities with a limited shell tool called `git-shell` that comes with Git.
85
-
If you set this as your 'git' user's login shell, then the 'git' user can't have normal shell access to your server.
84
+
You can easily restrict the `git` user to only doing Git activities with a limited shell tool called `git-shell` that comes with Git.
85
+
If you set this as your `git` user's login shell, then the `git` user can't have normal shell access to your server.
86
86
To use this, specify `git-shell` instead of bash or csh for your user's login shell.
87
87
To do so, you must first add `git-shell` to `/etc/shells` if it's not already there:
88
88
@@ -100,7 +100,7 @@ Now you can edit the shell for a user using `chsh <username>`:
100
100
$ sudo chsh git # and enter the path to git-shell, usually: /usr/bin/git-shell
101
101
----
102
102
103
-
Now, the 'git' user can only use the SSH connection to push and pull Git repositories and can't shell onto the machine.
103
+
Now, the `git` user can only use the SSH connection to push and pull Git repositories and can't shell onto the machine.
104
104
If you try, you'll see a login rejection like this:
105
105
106
106
[source,console]
@@ -112,6 +112,6 @@ Connection to gitserver closed.
112
112
----
113
113
114
114
Now Git network commands will still work just fine but the users won't be able to get a shell.
115
-
As the output states, you can also set up a directory in the ``git'' user's home directory that customizes the `git-shell` command a bit.
115
+
As the output states, you can also set up a directory in the `git` user's home directory that customizes the `git-shell` command a bit.
116
116
For instance, you can restrict the Git commands that the server will accept or you can customize the message that users see if they try to SSH in like that.
117
117
Run `git help shell` for more information on customizing the shell.(((git commands, help)))
0 commit comments