LinuxCommandLibrary

gh-ssh-key

Manage SSH keys for GitHub authentication

TLDR

List SSH keys

$ gh ssh-key list
copy
Add an SSH key
$ gh ssh-key add [key.pub]
copy
Add with title
$ gh ssh-key add [key.pub] -t "[title]"
copy
Delete an SSH key
$ gh ssh-key delete [key_id]
copy

SYNOPSIS

gh ssh-key command [options]

DESCRIPTION

gh ssh-key manages SSH public keys associated with your GitHub account for secure Git authentication. SSH keys provide an alternative to HTTPS authentication, enabling passwordless git operations.
The command supports adding new SSH keys from public key files, typically generated with ssh-keygen. Keys can be labeled with titles for identification when managing multiple keys across different machines. Deletion removes keys from your GitHub account, immediately revoking access.

PARAMETERS

-t, --title title

Key title.

SUBCOMMANDS

list

List SSH keys.
add
Add an SSH key.
delete
Delete an SSH key.

SEE ALSO

gh(1), gh-gpg-key(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community