Learn how to clone the repository using SSH.
To clone the repository using an SSH key, you need an SSH key pair. For a list of public key SSH fingerprints and corresponding regions applicable for DevOps source code management (SCM), see SSH Fingerprints. You can be an IAM user or a federated user. IAM users can be part of a domain. An identity domain is a container for managing users and roles.
Setting up SSH AuthenticationIf you already have a SSH key pair, then you can use the same. By default, SSH keys are stored in the system's ~/.ssh
directory.
To generate a SSH key pair, follow the given steps:
Enter the following command:
ssh-keygen -t rsa -C "<user.alias>@"
If you're using OpenSSH format key, use the following command:
ssh-keygen -f ~/.ssh/id_rsa.pub -e -m pkcs8 | pbcopy
If you're using OCI API signing key, use the following command:
cat ~/.oci/oci_api_key_public.pem | pbcopy
You can set up the Git username in the OpenSSH configuration file or embed the Git username in SSH URL.
~/.ssh/config
file exists in the default location.
open ~/.ssh/config
touch ~/.ssh/config
~/.ssh/config
to specify the user and key to use for the git clone
operation. The format for the host entry in the configuration file is:
Host <CodeRepositoryHost>
User <userName>@<tenancyName>
IdentityFile <PathToYourSSHPrivateKey>
File format for an IAM user part of a domain is:
Host <CodeRepositoryHost>
User <domainName>/<userName>@<tenancyName>
IdentityFile <PathToYourSSHPrivateKey>
The SSH user is a combination of the login username and tenancy name. For example, if you're using a
federated user, then the code repository's SSH user for Git is,
Federation/userName@tenancyName
. In the user string:
Federation
is optional and is the federated identity provider.userName
is the user who signs in to the OCI Console.tenancyName
is the name of the tenancy, which you can find in the OCI Console.Example,
oracleidentitycloudservice/the-product-manager-user@my-tenancy
The SSH user string need not be URL encoded or escaped. For example, for a code repository in the Ashburn region, the host configuration entry is:
Host devops.scmservice.us-ashburn-1.oci.oraclecloud.com
User the-product-manager-user@my-tenancy
IdentityFile ~/.ssh/id_rsa
For all OCI regions, you can use a wildcard for the host, for example, Host devops.scmservice.*.oci.oraclecloud.com
.
To set up Git username in SSH URL, follow the given steps:
ssh://<userName>@<tenancyName>@<sshUrl>
SSH URL for a user in a domain:
ssh://<domainName>/<userName>@<tenancyName>@<sshUrl>
ssh-add -K ~/.ssh/id_rsa
git clone
command with the SSH URL that you copied from the Cloud Console.
For example, git clone ssh://devops.scmservice.us-ashburn-1.oci.oraclecloud.com/namespaces/MY-TENANCY/projects/PROJECT-NAME/repositories/REPO-NAME
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4