---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.2
alternate:
  - https://sourcecraft.dev/portal/docs/en/sourcecraft/qa/sourcecraft-security.md
  - https://sourcecraft.dev/portal/docs/ru/sourcecraft/qa/sourcecraft-security.md
  - href: en/sourcecraft/qa/sourcecraft-security.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://sourcecraft.dev/portal/docs/en/llms.txt

<!-- source: en/_qa/sourcecraft/sourcecraft-security.md -->
# SSH access FAQ in SourceCraft

<!-- source: en/_qa/sourcecraft/sourcecraft-security-toc.md -->
* [How do I test an SSH connection?](https://sourcecraft.dev/portal/docs/en/sourcecraft/qa/sourcecraft-security.md#verify-ssh)
* [How do I use SSH over an HTTPS port?](https://sourcecraft.dev/portal/docs/en/sourcecraft/qa/sourcecraft-security.md#ssh-https-use)
* [How to set up an SSH connection over HTTPS?](https://sourcecraft.dev/portal/docs/en/sourcecraft/qa/sourcecraft-security.md#ssh-https-config)
* [How do I update my list of known hosts?](https://sourcecraft.dev/portal/docs/en/sourcecraft/qa/sourcecraft-security.md#ssh-hosts-update)
<!-- endsource: en/_qa/sourcecraft/sourcecraft-security-toc.md -->

### How do I test an SSH connection? {#verify-ssh}

To learn how to add an SSH key and access a [repository](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/index.md#repos), see [Accessing a repository with an SSH key](https://sourcecraft.dev/portal/docs/en/sourcecraft/security/ssh.md).

After adding the SSH key, run this command:

```bash
ssh -T ssh://ssh.sourcecraft.dev
```

If authenticated successfully, you will see this message:

<!-- source: en/_includes/sourcecraft/auth-text.md -->
```text
Hi <username>! You've successfully authenticated, but SourceCraft does not provide shell access.
```
<!-- endsource: en/_includes/sourcecraft/auth-text.md -->

### How do I use SSH over HTTPS port? {#ssh-https-use}

If your firewall blocks SSH connections and cloning over [HTTPS](https://en.wikipedia.org/wiki/HTTPS) with a [personal token](https://sourcecraft.dev/portal/docs/en/sourcecraft/security/pat.md) is unavailable, try cloning the repository via SSH over the HTTPS port. This connection is usually allowed by firewalls, but may be blocked by proxy servers.

To check if SSH connection is possible via the HTTPS port, run this command:

```bash
ssh -T -p 443 ssh.sourcecraft.dev
```

If authenticated successfully, you will see this message:

<!-- source: en/_includes/sourcecraft/auth-text.md -->
```text
Hi <username>! You've successfully authenticated, but SourceCraft does not provide shell access.
```
<!-- endsource: en/_includes/sourcecraft/auth-text.md -->

{% note info %}

For port `443`, use the `ssh.sourcecraft.dev` hostname, not `sourcecraft.dev`.

{% endnote %}

To clone the [repository](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/index.md#repos) via port `443`, run this command:

```shell
git clone ssh://ssh.sourcecraft.dev:443/<username>/<repository_name>.git
```

### How do I set up an SSH connection via HTTPS? {#ssh-https-config}

If connecting to `ssh.sourcecraft.dev` on port `443` works, you can configure SSH so that all connections to `sourcecraft.dev` automatically use this host and port.

To do this, edit the `~/.ssh/config` file and add the following section to it:

```text
Host sourcecraft.dev
    Hostname ssh.sourcecraft.dev
    Port 443
    User git
```

To check that the settings are applied, connect to `sourcecraft.dev` again:

```bash
ssh -T sourcecraft.dev
```

If the connection is successful, you will see this message:

<!-- source: en/_includes/sourcecraft/auth-text.md -->
```text
Hi <username>! You've successfully authenticated, but SourceCraft does not provide shell access.
```
<!-- endsource: en/_includes/sourcecraft/auth-text.md -->

### How do I update my list of known hosts?{#ssh-hosts-update}

If this is your first time connecting to SourceCraft, you will get an unknown host warning:

```text
The authenticity of host '[ssh.sourcecraft.dev]:443 ([<IP_address>]:443)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbp********.
This host key is known by the following other names/addresses:
    ~/.ssh/known_hosts:32: sourcecraft.dev
Are you sure you want to continue connecting (yes/no/[fingerprint])?
```
Type `yes` into the terminal and press **Enter**.
<!-- endsource: en/_qa/sourcecraft/sourcecraft-security.md -->