Skip to content

Commit 527f45d

Browse files
erichanson1Copilotmchammer01
authored
Add Instructions for using SSH on a Regional GHE Instance (#60206)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com>
1 parent c07ca44 commit 527f45d

File tree

7 files changed

+49
-0
lines changed

7 files changed

+49
-0
lines changed

content/admin/data-residency/feature-overview-for-github-enterprise-cloud-with-data-residency.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ The following examples are not exhaustive.
7171
| OIDC trusts for {% data variables.product.prodname_actions %} deployments | The OIDC token is issued from `https://token.actions.githubusercontent.com`. | The OIDC token is issued from `https://token.actions.SUBDOMAIN.ghe.com` |
7272
| Raw URLs | `https://raw.githubusercontent.com/` | `https://raw.SUBDOMAIN.ghe.com/` |
7373
| Anonymized URLs for images and videos | `https://private-user-images.githubusercontent.com/` | `https://SUBDOMAIN.ghe.com/user-attachments/assets/` |
74+
| Cloning repositories using SSH | `git clone git@github.com:OWNER/REPOSITORY.git` | `git clone SUBDOMAIN@SUBDOMAIN.ghe.com:OWNER/REPOSITORY.git` |
7475

7576
{% endrowheaders %}
7677

content/admin/data-residency/network-details-for-ghecom.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ gh api /meta --hostname octocorp.ghe.com
2727

2828
For more information, see [AUTOTITLE](/rest/meta/meta).
2929

30+
## Using SSH with {% data variables.enterprise.data_residency_site %}
31+
32+
To clone a repository using Git over SSH from `{% data variables.enterprise.data_residency_domain %}`, where SUBDOMAIN is your enterprise's dedicated subdomain on {% data variables.enterprise.data_residency_site %}, use the SUBDOMAIN as the SSH username instead of `git`.
33+
34+
```shell
35+
git clone SUBDOMAIN@SUBDOMAIN.ghe.com:OWNER/REPO.git
36+
```
37+
3038
## {% data variables.product.github %}'s hostnames
3139

3240
* `*.{% data variables.enterprise.data_residency_domain %}`, where SUBDOMAIN is your enterprise's dedicated subdomain on {% data variables.enterprise.data_residency_site %}

content/authentication/connecting-to-github-with-ssh/managing-deploy-keys.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,22 @@ For enhanced security and fine-grained control over repository access and permis
103103

104104
You can also use the REST API to create deploy keys. For more information, see [AUTOTITLE](/rest/deploy-keys/deploy-keys).
105105

106+
You can then interact with the repository using SSH. For example:
107+
108+
```bash
109+
git clone git@{% ifversion fpt or ghec %}github.com{% else %}my-GHE-hostname.com{% endif %}:OWNER/REPO.git
110+
```
111+
112+
{% ifversion ghec %}
113+
114+
> [!NOTE] {% data reusables.enterprise-data-residency.ssh-user %}
115+
>
116+
> ```bash
117+
> git clone {% data variables.enterprise.data_residency_example_git_ssh %}:OWNER/REPO.git
118+
> ```
119+
120+
{% endif %}
121+
106122
### Using multiple repositories on one server
107123
108124
If you use multiple repositories on one server, you will need to generate a dedicated key pair for each one. You can't reuse a deploy key for multiple repositories.

content/authentication/connecting-to-github-with-ssh/testing-your-ssh-connection.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,14 @@ You'll need to authenticate this action using your password, which is the SSH ke
6969
> The remote command should exit with code 1.
7070
7171
1. Verify that the resulting message contains your username. If you receive a "permission denied" message, see [AUTOTITLE](/authentication/troubleshooting-ssh/error-permission-denied-publickey).
72+
73+
{% ifversion ghec or fpt %}
74+
75+
> [!TIP] {% data reusables.enterprise-data-residency.ssh-user %}
76+
>
77+
> ```shell
78+
> ssh -T {% data variables.enterprise.data_residency_example_git_ssh %}
79+
> # Attempts to ssh to {% data variables.enterprise.data_residency_example_domain %}
80+
> ```
81+
82+
{% endif %}

content/authentication/troubleshooting-ssh/error-permission-denied-publickey.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,17 @@ You should see this output:
6868
> Hi USERNAME! You've successfully authenticated...
6969
```
7070
71+
{% ifversion ghec %}
72+
73+
> [!WARNING]
74+
> {% data reusables.enterprise-data-residency.ssh-user %}
75+
>
76+
> ```shell
77+
> ssh -T {% data variables.enterprise.data_residency_example_git_ssh %}
78+
> ```
79+
80+
{% endif %}
81+
7182
## Make sure you have a key that is being used
7283
7384
{% mac %}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
If you are accessing {% data variables.product.github %} at a different domain such as `{% data variables.enterprise.data_residency_example_domain %}`, then you need to replace `git@{% data variables.product.product_url %}` with `{% data variables.enterprise.data_residency_example_git_ssh %}`.

data/variables/enterprise.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ data_residency_site: 'GHE.com'
1616
data_residency_domain: 'SUBDOMAIN.ghe.com'
1717
data_residency_api: 'api.SUBDOMAIN.ghe.com'
1818
data_residency_example_domain: 'octocorp.ghe.com'
19+
data_residency_example_git_ssh: 'octocorp@octocorp.ghe.com'
1920

2021
# GitHub Connect (enterprise accounts, other unified features)
2122
## Phrase content so that the uncapitalized unified contributions or unified search variables are not used at the start of a sentence.

0 commit comments

Comments
 (0)