Connecting to Private Repository via SSH
Using Direct SSH Key
If you use a private repository using an SSH Key, you need to have an SSH key pair ready and enter your private key to Appcircle so Appcircle can access your repository.
For the SSH key field in the repository connection, the private key is required. The public key is entered/stored in the Git provider while the private key is entered in Appcircle.
If you are using Azure Devops Server as a git provider, its version must be 2022 or later.
Azure Devops Server 2020 and older versions are not supported due to reduced security.
To generate a new key pair, you can run the following command:
- macOS/Linux
- Windows
ssh-keygen -t rsa -b 4096 -P '' -f ./appcircle-ssh -m PEM
PowerShell
ssh-keygen -t rsa -b 4096 -P '""' -f ./appcircle-ssh -m PEM
Command Prompt
ssh-keygen -t rsa -b 4096 -P "" -f ./appcircle-ssh -m PEM
SSH keys generated should not contain a password. If ssh-keygen prompts you for a password, simply press Enter to skip the password prompt. Verify that your appcircle-ssh
file was created without the header Proc-Type: 4, ENCRYPTED
.
Two files will be created as appcircle-ssh.pub
(Public key) and appcircle-ssh
(Private key)
You can then run the cat ./appcircle-ssh
command and enter its output to Appcircle and run the cat ./appcircle-ssh.pub
command and enter its output to the SSH keys section of the Git provider.
Select **Connect via SSH **through the connection selection
Then, enter your relevant information to connect to the private repository:
After the connection is successful, you can view your newly created profile and start building!
To enable triggered auto builds with webhooks for SSH repository connections, please refer to the following guide: Build Manually or Automatically with Webhooks and Triggers
Connection Notice
If your SSH server runs on a different port, you should add the port number to your connection string.
ssh://git@mydomain.com:port/path/to/repo.git
For Appcircle to connect to the self hosted repositories, your connection must be reachable over the internet.
Is your self-hosted GitLab instance under an enterprise firewall? Learn which IP addresses and ports Appcircle uses to function under the whitelist documentation:
Accessing Repositories in Internal Networks (Firewalls)
How to connect to AWS CodeCommit repositories through SSH?
AWS CodeCommit requires the creation of a dedicated user for repository connections through SSH (i.e. the root user cannot be used for this purpose).
- First, create a user in AWS IAM and assign the following permissions to the user:
- Go to IAM -> Users -> User -> Security credentials and select "Upload SSH key".
- Take a note of the SSH key ID generated by AWS as follows:
- Once you login with the newly generated user and copy the repository URL in SSH format, you will receive URL as follows:
ssh://git-codecommit.us-east-2.amazonaws.com/v1/repos/MyDemoRepo
- For the SSH connection to be initialized, you need to add the public key to your URL to have it in the following format, which then can be entered in Appcircle to be used in SSH connections.
ssh://Your-SSH-Key-ID@git-codecommit.us-east-2.amazonaws.com/v1/repos/MyDemoRepo
Need help?
Get help from Appcircle's support team, or see how others are using Appcircle by joining our Slack Channel.