Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference between account ssh-key vs deployment ssh-key

Can someone please explain what is the difference between account ssh-key vs deployment ssh-key?

I have made use of them frequently but never tried to learn how they differ.

like image 587
Prashant Bhanarkar Avatar asked Sep 23 '16 11:09

Prashant Bhanarkar


People also ask

Is deploy key and SSH key same?

You can launch projects from a repository on GitHub.com to your server by using a deploy key, which is an SSH key that grants access to a single repository. GitHub attaches the public part of the key directly to your repository instead of a personal account, and the private part of the key remains on your server.

What is SSH deploy key?

A GitHub deploy key is an SSH key that gives read –and optionally write– access to a single repository on GitHub. It makes it easy to pull your app's code to a server automatically. With a deploy key, you just connect to your server, do a git fetch , and you're done!

What are deployment keys?

A deploy key is an SSH key that is stored on your server and grants access to a single GitHub repository. They are often used to clone repositories during deploys or continuous integration runs. Deploys sometimes involve merging branches and pushing code, so deploy keys have always allowed both read and write access.

Can you use the same SSH key on multiple accounts?

No. GitHub uses the SSH key to identify the account, so only one account may use a specific key.


1 Answers

Your ssh account key does identify you, and allows you to interact with GitHub as you (meaning for instance; you can push to your own repo)

Your ssh deploy key, as mentioned in "Read-only deploy keys" are keys with read-only access.
It does not authenticate you.

A deploy key is an SSH key that is stored on your server and grants access to a single GitHub repository. They are often used to clone repositories during deploys or continuous integration runs.
Deploys sometimes involve merging branches and pushing code, so deploy keys have always allowed both read and write access. Because write access is undesirable in many cases, you now have the ability to create deploy keys with read-only access.

You can create a read/write deploy key, but its ability to be read-only is in contrast with an account SSH key: the latter (SSH key) will always be for read/write access to your repositories.

You find the same purpose for deploy keys at BitBucket:

A deployment key grants read-only access to a public or private repository. With a deployment key a user or a process can pull or clone a repository over SSH. Deployment keys have the following features and limitations:

  • Deployment keys do not apply to your plan limit.
  • You can add the same deployment key to multiple repositories.
  • The deployment key must be unique — it cannot also be associated with an account.
like image 103
VonC Avatar answered Oct 22 '22 18:10

VonC