While we recommend HTTPS because it is generally easier to set up, you can also use SSH keys to establish a secure connection between your computer and GitHub. The steps below will walk you through generating an SSH key and then adding the public key to your GitHub account.
Step 1: Check for SSH keys
First, we need to check for existing ssh keys on your computer. Open up Terminal and run:
cd ~/.ssh ls # Lists the files in your .ssh directory
Check the directory listing to see if you have a file named either id_rsa.pub
or id_dsa.pub
. If you don't have either of those files go to step 2. Otherwise, you already have an existing keypair, and you can skip to step 3.
Step 2: Generate a new SSH key
To generate a new SSH key, enter the code below. We want the default settings so when asked to enter a file in which to save the key, just press enter.
ssh-keygen -t rsa -C "your_email@example.com" # Creates a new ssh key, using the provided email as a label # Generating public/private rsa key pair. # Enter file in which to save the key (/home/you/.ssh/id_rsa): ssh-add id_rsa
Now you need to enter a passphrase.
# Enter passphrase (empty for no passphrase): [Type a passphrase] # Enter same passphrase again: [Type passphrase again]
Which should give you something like this:
# Your identification has been saved in /home/you/.ssh/id_rsa. # Your public key has been saved in /home/you/.ssh/id_rsa.pub. # The key fingerprint is: # 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@example.com
Run the following code to copy the key to your clipboard.
sudo apt-get install xclip # Downloads and installs xclip. If you don't have `apt-get`, you might need to use another installer (like `yum`) xclip -sel clip < ~/.ssh/id_rsa.pub # Copies the contents of the id_rsa.pub file to your clipboard
相关推荐
Generating Functionology
<Switch> system-view [Switch] public-key local create rsa The range of public key size is (512 ~ 2048). NOTES: If the key modulus is ...Input the bits of the modulus[default = 1024]: Generating Keys...
Generating Artifacts问题三种解决办法
adv Generating a Map Application源码
adv Generating a Map Application 题目
Tom Copeland - Generating Parsers with JavaCC-Centennial Books (2009)
Episode-Based Prototype Generating Network for Zero-Shot Learning.pdf
Generating Random Networks and Graphs By 作者: Ton Coolen – Alessia Annibale – Ekaterina Roberts ISBN-10 书号: 0198709897 ISBN-13 书号: 9780198709893 Edition 版本: 1 出版日期: 2017-05-23 pages 页数...
Sat dump editor tool, for generating RSA keys from the card boxkey.
此文档不完整,请下载另外一份。 谢谢大家支持我。
In this paper, we analyze the disadvantage of common generating test paper algorithms, an improved Particle Swarm Optimization is proposed and used in Auto-generating Test Paper Algorithm. We design ...
# cd /etc/ssh[root@ha01 ssh]# ssh-keygen -t rsa -N “” (该步骤生成key公私密钥对,-N “”表示密钥对短语为空)Generating public/private rsa key pair.Enter file in which to save the key (/root/.ssh/id_...
WC Yeh-universal generating MPs
Generating Word Reports _ Documentssrc1
关于泊松点过程的生成方法-Generating Homogeneous Poisson Processes - PDF.pdf 在百度上看很多人问平面内泊松点怎么生成,以前我也迷茫的很久,刚好今天找到一个很有用的方法,分享给大家! Report1_...
Generating keys nrfutil.exe keys generate private.key
Herbert S. Wilf Department of Mathematics University of Pennsylvania Philadelphia, Pennsylvania
Self-generating-code.zip
WEPGen uses the defacto standard for generating WEP keys used by most wireless routers. It supports Netgear, Linksys, etc. and is compatible with alternate firmware like 'Tomato'. Easy to use: ...
一、问题 如上,A机器经常需远程操作B机器,传输文件到B机器,每次输入帐号... Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Your identification has bee