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
GitLab Shell handles git SSH sessions for GitLab and modifies the list of authorized keys.
12
14
GitLab Shell is not a Unix shell nor a replacement for Bash or Zsh.
13
15
16
+
GitLab supports Git LFS authentication through SSH.
17
+
18
+
## Requirements
19
+
20
+
GitLab Shell is written in Go, and needs a Go compiler to build. It still requires
21
+
Ruby to build and test, but not to run.
22
+
23
+
GitLab Shell runs on `port 22` on an Omnibus installation. To use a regular SSH
24
+
service, configure it on an alternative port.
25
+
26
+
Download and install the current version of Go from [golang.org](https://golang.org/dl/)
27
+
We follow the [Golang Release Policy](https://golang.org/doc/devel/release.html#policy)
28
+
of supporting the current stable version and the previous two major versions.
29
+
30
+
## How GitLab Shell works
31
+
14
32
When you access the GitLab server over SSH then GitLab Shell will:
15
33
16
-
1. Limit you to predefined git commands (git push, git pull).
34
+
1. Limit you to predefined git commands (`git push`, `git pull`, `git fetch`).
17
35
1. Call the GitLab Rails API to check if you are authorized, and what Gitaly server your repository is on
18
36
1. Copy data back and forth between the SSH client and the Gitaly server
19
37
20
38
If you access a GitLab server over HTTP(S) you end up in [gitlab-workhorse](https://gitlab.com/gitlab-org/gitlab/tree/master/workhorse).
21
39
22
-
An overview of the four cases described above:
40
+
### `git pull` over SSH
23
41
24
42
1. git pull over SSH -> gitlab-shell -> API call to gitlab-rails (Authorization) -> accept or decline -> establish Gitaly session
25
-
1. git push over SSH -> gitlab-shell (git command is not executed yet) -> establish Gitaly session -> (in Gitaly) gitlab-shell pre-receive hook -> API call to gitlab-rails (authorization) -> accept or decline push
1. git push over SSH -> gitlab-shell (git command is not executed yet) -> establish Gitaly session -> (in Gitaly) gitlab-shell pre-receive hook -> API call to gitlab-rails (authorization) -> accept or decline push
36
47
37
-
GitLab Shell is written in Go, and needs a Go compiler to build. It still requires
38
-
Ruby to build and test, but not to run.
48
+
[Full feature list](doc/features.md)
39
49
40
-
Download and install the current version of Go from https://golang.org/dl/
50
+
### Modifies `authorized_keys`
41
51
42
-
We follow the [Golang Release Policy](https://golang.org/doc/devel/release.html#policy)
43
-
of supporting the current stable version and the previous two major versions.
52
+
GitLab Shell modifies the `authorized_keys` file on the client machine.
44
53
45
54
## Rate Limiting
46
55
@@ -102,3 +111,7 @@ See [PROCESS.md](./PROCESS.md)
102
111
## License
103
112
104
113
See [LICENSE](./LICENSE).
114
+
115
+
## Related topics
116
+
117
+
-[Using the GitLab Shell chart](https://docs.gitlab.com/charts/charts/gitlab/gitlab-shell/#using-the-gitlab-shell-chart)
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
5
+
---
6
+
7
+
# GitLab Shell architecture
8
+
9
+
```mermaid
10
+
sequenceDiagram
11
+
participant Git on client
12
+
participant SSH server
13
+
participant AuthorizedKeysCommand
14
+
participant GitLab Shell
15
+
participant Rails
16
+
participant Gitaly
17
+
participant Git on server
18
+
19
+
Note left of Git on client: git fetch
20
+
Git on client->>+SSH server: ssh git fetch-pack request
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
5
+
---
6
+
7
+
# gitlab-sshd
8
+
9
+
`gitlab-sshd` is a binary in [`gitlab-shell`](https://gitlab.com/gitlab-org/gitlab-shell)
10
+
which runs as a persistent SSH daemon. It will replace `OpenSSH` on GitLab SaaS,
11
+
and eventually other cloud-native environments. Instead of running an `sshd` process,
12
+
we run a `gitlab-sshd` process that does the same job, in a more focused manner:
13
+
14
+
```mermaid
15
+
sequenceDiagram
16
+
participant Git on client
17
+
participant GitLab SSHD
18
+
participant Rails
19
+
participant Gitaly
20
+
participant Git on server
21
+
22
+
Note left of Git on client: git fetch
23
+
Git on client->>+GitLab SSHD: ssh git fetch-pack request
24
+
GitLab SSHD->>+Rails: GET /internal/api/authorized_keys?key=AAAA...
0 commit comments