ssh-keygen
command to generate SSH public and private key files. By default, these files are created in the ~/.ssh directory. You can specify a different location, and an optional password (passphrase) to access the private key file. If an SSH key pair with the same name exists in the given location, those files are overwritten.--generate-ssh-keys
option. The key files are stored in the ~/.ssh directory unless specified otherwise with the --ssh-dest-key-path
option. The --generate-ssh-keys
option will not overwrite existing key files, instead returning an error. In the following command, replace VMname and RGname with your own values:cat
command, replacing ~/.ssh/id_rsa.pub
with the path and filename of your own public key file if needed:pbcopy
. Similarly in Linux, you can pipe the public key file to programs such as xclip
.--ssh-key-values
option. In the following command, replace VMname, RGname, and keyFile with your own values:--ssh-key-values sshkey-desktop.pub sshkey-laptop.pub
.title | description | ms.topic | ms.assetid | ms.custom | ms.author | author | ms.date | monikerRange |
---|---|---|---|---|---|---|---|---|
Install an SSH key prior to a build or release | 5c9af2eb-5fc5-42dc-9b91-dc234a8c4400 | vijayma | 02/02/2019 |
Argument | Description |
---|---|
Known Hosts Entry | (Required) The entry for this SSH key for the known_hosts file. |
SSH Public Key | (Required) The contents of the public SSH key. |
SSH Passphrase | (Optional) The passphrase for the SSH key, if any. |
SSH Key (Secure File) | (Required) Select the SSH key that was uploaded to Secure Files to install on the agent. |
ssh-keygen
- a program that is provided with the SSH package on Linux and macOS and comes with Git for Windows. When you run ssh-keygen
, you will be prompted to provide an SSH passphrase and two files will be created: a public key and a private key (e.g. mykey.pub
and mykey
).mykey.pub
(public) SSH key to GitHub (see GitHub's documentation for help).ssh-add ~/.ssh/mykey
, replacing ~/.ssh/mykey
with the path to your private key file.git clone [email protected]:myOrganizationName/myRepositoryName.git
).known_hosts
file.known_hosts
file (~/.ssh/known_hosts
or C:Users<username>.sshknown_hosts
) and copy the line that was added.