UNPKG

epubjs

Version:

Render ePub documents in the browser, across many devices

52 lines (42 loc) 3.65 kB
<?xml version='1.0' encoding='utf-8'?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Pro Git - professional version control</title> <meta content="http://www.w3.org/1999/xhtml; charset=utf-8" http-equiv="Content-Type"/> <link href="stylesheet.css" type="text/css" rel="stylesheet"/> <style type="text/css"> @page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; }</style> </head> <body class="calibre"> <h2 class="calibre4" id="calibre_pb_32">Generating Your SSH Public Key</h2> <p class="calibre3">That being said, many Git servers authenticate using SSH public keys. In order to provide a public key, each user in your system must generate one if they don't already have one. This process is similar across all operating systems. First, you should check to make sure you don't already have a key. By default, a user's SSH keys are stored in that user's <code class="calibre10">~/.ssh</code> directory. You can easily check to see if you have a key already by going to that directory and listing the contents:</p> <pre class="calibre9"><code class="calibre10">$ cd ~/.ssh $ ls authorized_keys2 id_dsa known_hosts config id_dsa.pub </code></pre> <p class="calibre3">You're looking for a pair of files named something and something.pub, where the something is usually <code class="calibre10">id_dsa</code> or <code class="calibre10">id_rsa</code>. The <code class="calibre10">.pub</code> file is your public key, and the other file is your private key. If you don't have these files (or you don't even have a <code class="calibre10">.ssh</code> directory), you can create them by running a program called <code class="calibre10">ssh-keygen</code>, which is provided with the SSH package on Linux/Mac systems and comes with the MSysGit package on Windows:</p> <pre class="calibre9"><code class="calibre10">$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/Users/schacon/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /Users/schacon/.ssh/id_rsa. Your public key has been saved in /Users/schacon/.ssh/id_rsa.pub. The key fingerprint is: 43:c5:5b:5f:b1:f1:50:43:ad:20:a6:92:6a:1f:9a:3a schacon@agadorlaptop.local </code></pre> <p class="calibre3">First it confirms where you want to save the key (<code class="calibre10">.ssh/id_rsa</code>), and then it asks twice for a passphrase, which you can leave empty if you don't want to type a password when you use the key.</p> <p class="calibre3">Now, each user that does this has to send their public key to you or whoever is administrating the Git server (assuming you're using an SSH server setup that requires public keys). All they have to do is copy the contents of the <code class="calibre10">.pub</code> file and e-mail it. The public keys look something like this:</p> <pre class="calibre9"><code class="calibre10">$ cat ~/.ssh/id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAklOUpkDHrfHY17SbrmTIpNLTGK9Tjom/BWDSU GPl+nafzlHDTYW7hdI4yZ5ew18JH4JW9jbhUFrviQzM7xlELEVf4h9lFX5QVkbPppSwg0cda3 Pbv7kOdJ/MTyBlWXFCR+HAo3FXRitBqxiX1nKhXpHAZsMciLq8V6RjsNAQwdsdMFvSlVK/7XA t3FaoJoAsncM1Q9x5+3V0Ww68/eIFmb1zuUFljQJKprrX88XypNDvjYNby6vw/Pb0rwert/En mZ+AW4OZPnTPI89ZPmVMLuayrD2cE86Z/il8b+gw3r3+1nKatmIkjn2so1d01QraTlMqVSsbx NrRFi9wrf+M7Q== schacon@agadorlaptop.local </code></pre> <p class="calibre3">For a more in-depth tutorial on creating an SSH key on multiple operating systems, see the GitHub guide on SSH keys at <code class="calibre10">http://github.com/guides/providing-your-ssh-key</code>.</p> </body> </html>