|
| 1 | +### Discover |
| 2 | + |
| 3 | +Allows users to identify themselves on an instance via SSH. The command is useful for checking out quickly whether a user has SSH access to the instance: |
| 4 | + |
| 5 | +```bash |
| 6 | +ssh git@<hostname> |
| 7 | + |
| 8 | +PTY allocation request failed on channel 0 |
| 9 | +Welcome to GitLab, @username! |
| 10 | +Connection to staging.gitlab.com closed. |
| 11 | +``` |
| 12 | + |
| 13 | +When permission is denied: |
| 14 | + |
| 15 | +```bash |
| 16 | +ssh git@<hostname> |
| 17 | +git@<hostname>: Permission denied (publickey). |
| 18 | +``` |
| 19 | + |
| 20 | +### Git operations |
| 21 | + |
| 22 | +Gitlab Shell provides support for Git operations over SSH via processing `git-upload-pack`, `git-receive-pack` and `git-upload-archive` SSH commands. It limit the set of commands to predefined git commands (git push, git clone/pull, git archive). |
| 23 | + |
| 24 | +### Generate new 2FA recovery codes |
| 25 | + |
| 26 | +Allows users to [generate new 2FA recovery codes](https://docs.gitlab.com/ee/user/profile/account/two_factor_authentication.html#generate-new-recovery-codes-using-ssh). |
| 27 | + |
| 28 | +```bash |
| 29 | +ssh git@<hostname> 2fa_recovery_codes |
| 30 | +Are you sure you want to generate new two-factor recovery codes? |
| 31 | +Any existing recovery codes you saved will be invalidated. (yes/no) |
| 32 | +yes |
| 33 | + |
| 34 | +Your two-factor authentication recovery codes are: |
| 35 | +... |
| 36 | +``` |
| 37 | + |
| 38 | +### Verify 2FA OTP |
| 39 | + |
| 40 | +Allows users to [verify their 2FA OTP](https://docs.gitlab.com/ee/security/two_factor_authentication.html#2fa-for-git-over-ssh-operations). |
| 41 | + |
| 42 | +```bash |
| 43 | +ssh git@<hostname> 2fa_verify |
| 44 | +OTP: 347419 |
| 45 | + |
| 46 | +OTP validation failed. |
| 47 | +``` |
| 48 | + |
| 49 | +### LFS authentication |
| 50 | + |
| 51 | +Allows users to generate credentials for LFS authentication. |
| 52 | + |
| 53 | +```bash |
| 54 | +ssh git@<hostname> git-lfs-authenticate <project-path> <upload/download> |
| 55 | + |
| 56 | +{"header":{"Authorization":"Basic ..."},"href":"https://gitlab.com/user/project.git/info/lfs","expires_in":7200} |
| 57 | +``` |
| 58 | + |
| 59 | +### Personal access token |
| 60 | + |
| 61 | +Allows users to personal access tokens via SSH |
| 62 | + |
| 63 | +```bash |
| 64 | +ssh git@<hostname> personal_access_token <name> <scope1[,scope2,...]> [ttl_days] |
| 65 | + |
| 66 | +Token: glpat-... |
| 67 | +Scopes: api |
| 68 | +Expires: 2022-02-05 |
| 69 | +``` |
0 commit comments