To securely connect your laptop to GitHub, you need to establish a trusted relationship using an SSH key. Follow these steps to generate and add your key:
🔗 Full instructions from GitHub
✅ 1. Generate a New SSH Key
Open a terminal:
- macOS/Linux: Open the Terminal app.
- Windows: Press
Start, typecmd, and open the Command Prompt.
Then enter the following command (replace with your email address):
ssh-keygen -t rsa -b 4096 -C "yourname@kenyon.edu"
- This creates a new RSA key pair and labels it with your email.
- You’ll see prompts—just press Enter to accept the defaults:
Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press Enter]
Enter passphrase (empty for no passphrase): [Press Enter]
Enter same passphrase again: [Press Enter]
✅ 2. Display Your Public Key
In the terminal, run:
cat ~/.ssh/id_rsa.pub
- This prints your public key.
- Copy the entire output—you’ll paste this into GitHub.
✅ 3. Add the SSH Key to GitHub
- Go to GitHub and log in.
- Click your profile icon (top right) → Settings.
- In the left sidebar, click SSH and GPG Keys.
- Click the green “New SSH Key” button.
- Fill in:
- Title: A name like
"My Laptop"or"Judy's MacBook". - Key: Paste the key you copied in step 2.
- Title: A name like
- Click Add SSH Key to save.
After this, GitHub and your laptop will trust each other, allowing you to push and pull code securely.
