ucsb-cs156.github.io Open in urlscan Pro
2606:50c0:8001::153  Public Scan

URL: https://ucsb-cs156.github.io/topics/GitHub/github_REMOTE_HOST_IDENTIFICATION_CHANGED.html
Submission: On July 13 via api from US — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

Link Search Menu Expand Document
CS156
 * CS156
 * Topics
   * APIs
   * Agile
     * Agile: Acceptance Criteria
     * Agile: Estimates
     * Agile: Retros
     * Agile: Standups
     * Agile: Team Norms
     * Agile: User Stories
   * Ant
     * Ant: Comparing files
     * Ant: Properties
   * Antipatterns
     * Antipatterns: inheritance
   * Applications Programming
   * Bug Reports
   * CI
   * CSIL
     * CSIL: Java 11
     * CSIL: Mount CSIL drive Via MacOS
     * CSIL: Mount CSIL drive Via Windows
     * CSIL: Remote Host Id Changed
     * CSIL: Via MacOS
     * CSIL: browser from command line
     * CSIL: disk quota and file quota issues
     * CSIL: git configuration
     * CSIL: ssh port forwarding
     * CSIL: using public/private key
     * CSIL: via ssh from Linux
     * CSIL: via ssh from Windows
   * CSV files
   * Code Reviews
     * Code Reviews: GitHub
   * Code Smells
   * Code Style
     * Code Style: astyle
   * Codecov
     * Codecov: GitHub Actions
     * Codecov: Transfering Repos
     * Codecov: Troubleshooting
   * Conventions
     * Conventions: Branch Names
     * Conventions: Commit Messages
     * Conventions: Tags
   * Course Policies
     * Course Policies: Answer Keys
   * Data
   * Databases
   * Design Patterns
     * Design Patterns: Strategy
   * Docker
   * Dokku
     * Deploying an App
     * Logging In
     * Getting Started
     * Enabling HTTPS
     * Environment Variables
     * Logs
     * Postgres Database
     * Preparing Your App
     * Redeploy App
   * Enviroment Variables
   * Eslint
   * Gauchospace
     * Gauchospace: Clickable URLs
     * Gauchospace: Defining Groups:
   * Git
     * git: .gitignore files
     * git: basic workflow
     * git: clean
     * git: cloning your first repo
     * git: commit messages
     * git: copy branch to new repo
     * git: feature branch workflow
     * git: fixup commit
     * git: git/github troubleshooting
     * git: merge conflicts
     * git: overview
     * git: pair repo
     * git: pull rebase main
   * GitHub
     * Graphql: GitHub Explorer
     * github.com: creating private repos under an organization
     * github.ucsb.edu: creating private repos under an organization
     * github: GitHub Pages
     * github: REMOTE HOST IDENTIFICATION CHANGED
     * github: actions
     * github: actions self hosted runners
     * github: adding collaborators
     * github: api
     * github: issues
     * github: keyboard shortcuts
     * github: markdown
     * github: pro tips
     * github: pull requests
     * github: using ssh keys
     * github: verified badge on commits
     * github: wrong starter
   * Gradescope
     * Gradescope: Organization Access
     * Gradescope: Pair/Group Submission
     * Gradescope: Regrade Requests
     * Gradescope: Student Self-Submission
     * Gradescope: Zip Submission
   * Gradle
   * Heroku
     * Heroku: Alternatives
     * Heroku: Billing and Quotas
     * Heroku: CLI
     * Heroku: Tips
     * Heroku: Troubleshooting
   * Independent Study
   * JSON
     * JSON: Jackson
   * JUnit
     * JUnit: Hamcrest Matcher style
     * JUnit: Mocking System.out
   * Java
     * Java: == vs. .equals(), and hashCode()
     * Java: Annotations
     * Java: ArrayList to array
     * Java: Codacy
     * Java: Command Line Arguments
     * Java: Garbage Collection
     * Java: Garbage Collection: Under the Hood
     * Java: HttpURLConnection
     * Java: Installing
     * Java: JAR files
     * Java: JVM
     * Java: Lambda Expressions
     * Java: Overriding vs. Overloading
     * Java: Plaform Independent Newlines
     * Java: Sorting
     * Java: Streams in Java 8
     * Java: Unchecked Operations
     * Java: Versions
     * Java: Web Applications
     * Java: static analysis
   * JavaFX
     * javafx: XQuartz on Mac
   * JavaScript
     * JavaScript: Destructuring
   * Javadoc
     * Javadoc: Legacy Code Projects
     * javadoc: publishing to github pages from a private repo
     * javadoc: publishing to github pages from a private repo (the old way)
     * javadoc: publishing to github pages from a public repo
   * Kanban
   * Legacy Code
     * Legacy Code: Courses Search
     * Legacy Code: Projects
     * Legacy Code: Roles
     * Legacy Code: Staff Epic Planning
     * Legacy Code: Terminal Windows
   * Log4J
     * Log4J: SparkJava
     * Log4J: Spring Boot
   * Lombok:
   * MacOS
     * MacOS: Common Errors
     * MacOS: Homebrew
   * Markdown
   * Maven
     * Maven: Adding custom jar dependency
     * Maven: Convert Ant to Maven
     * Maven: FAQ
     * Maven: Hello World
     * Maven: Installing
     * Maven: Javadoc
     * Maven: Managing Versions
     * Maven: Plugins
     * Maven: Plugins
     * Maven: Pom.xml Order
     * Maven: Profiles
     * Maven: Skip Tests
     * Maven: Testing
     * Maven: Wrapper
     * Maven: Xlint options
     * Maven: vs Ant
   * MongoDB
     * MongoDB: New Database
     * MongoDB: SSL certificate
     * MongoDB: Spring Boot - Basic Collection
     * MongoDB: Spring Boot - Nested Document
     * MongoDB: Spring Properties
     * MongoDB: Staff Setup
   * Node
     * Node: Linux
     * Node: MacOS
     * Node: Windows
     * Node: npm
     * Node: nvm
     * Node: package-lock.json merge conflicts
   * OAuth
     * Google: Create Developer Project
     * Google: OAuth Consent Screen
     * OAuth: Authorizing GitHub Third Party Apps
     * OAuth: GitHub Setup
     * OAuth: Google Setup
     * OAuth: Troubleshooting
   * OOP
   * PIT Mutation Testing
   * Port Numbers
   * Pull Requests
   * Pulse Secure
   * REST
   * React
     * React: Create React App
     * React: Introduction
     * React: Page Components
     * React: Patterns
     * React: Router
     * React: Spring Boot
     * React: Storybook
     * React: UseSWR
     * React: react-hook-form
   * Refactoring
   * Render
     * Deploying a public repo to Render
     * Deploying any repo to Render
     * Set Environment Variables
   * SQL
     * SQL: Liquibase
     * SQL: Postgres
   * Scrum
   * Selenium
     * Selenium: Driver Setup
   * Semantic Versioning
   * Slack
   * Sockets
   * Spring Boot
     * Spring Boot: Actuator
     * Spring Boot: Application Properties
     * Spring Boot: CSV
     * Spring Boot: ControllerAdvice
     * Spring Boot: Database
     * Spring Boot: Database Migrations
     * Spring Boot: Heroku
     * Spring Boot: Logging
     * Spring Boot: OAuth
     * Spring Boot: POST and CSRF
     * Spring Boot: Postgres
     * Spring Boot: Profiles
     * Spring Boot: RestTemplate
     * Spring Boot: SQL
     * Spring Boot: Secrets
     * Spring Boot: Security
     * Spring Boot: Sessions
     * Spring Boot: Testing
     * Spring Boot: VS Code
   * Spring/React
     * Spring/React: Basic CRUD operations
     * Spring/React: Directory Structure
     * Spring/React: Future Work
     * Spring/React: Practices
     * Spring/React: package-lock.json Merge Conflicts
   * Stryker
     * Stryker: Excluding Code
     * Stryker: console.log surviving mutants
     * Stryker: html attribute surviving mutants
   * Swagger
   * Swing
   * Teamwork
   * Test Driven Development (TDD)
   * Testing
     * Testing: Articles
     * Testing: Coverage
     * Testing: Integration Testing with Maven
     * Testing: JUnit
     * Testing: Jacoco
     * Testing: Jacoco via Maven
     * Testing: Jest Testing
     * Testing: Maven Tips
     * Testing: Mocking
     * Testing: Pitest
     * Testing: React
     * Testing: Spring Boot HTMLUnit
     * Testing: npm test
   * Thymeleaf
   * Toasts
   * Toolchain
   * UCSB CS Github Linker
   * UML
   * Unix (and Linux)
   * User Stories
   * VS Code
     * vscode: CR/LF
   * Vim
     * vim: basic eight
     * vim: customization
   * Webapps
     * Webapps vs. Websites
   * Windows
     * Windows: WSL
   * YAML
   * graphql
 * Past Offerings
 * Textbooks
   * HFJ3
     * HFJ3: Chapter 1
     * HFJ3: Chapter 2
     * HFJ3: Chapter 3
     * HFJ3: Chapter 4
     * HFJ3: Chapter 5
   * JN7
     * JN7: Chapter 1
   * JN8
     * JN8: Chapter 1
 * Tutorials
   * Student
     * Student: ex01
     * Student: ex02
     * Student: ex03
     * Student: ex04
     * Student: ex05
     * Student: ex06
     * Student: ex07
     * Student: ex08
     * Student: ex09
     * Student: ex10
     * Student: ex11
     * Student: ex12
     * Student: ex13
     * Student: ex14
     * Student: ex15
     * Student: ex16
     * Student: ex17

This site uses Just the Docs, a documentation theme for Jekyll.
 * M23
 * S23
 * F22
 * S22
 * cs156 docs repo
 * Canvas

 1. Topics
 2. GitHub
 3. github: REMOTE HOST IDENTIFICATION CHANGED

If you’ve used ssh to connect to GitHub in the past (specifically, before 05:00
UTC on March 24, 2023) then the first time you connect to GitHub using ssh after
05:00 UTC on March 24, 2023 (e.g. doing a git clone, git pull or git push
operation), you’ll get this scary message:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s.
Please contact your system administrator.
Add correct host key in /Users/pconrad/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/pconrad/.ssh/known_hosts:4
Host key for github.com has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


The rest of this page explains why this is happening, and what to do to fix it.


WHY IS THIS HAPPENING?

Basically, someone at GitHub goofed, and they had to update their public/private
key pair: https://github.blog/2023-03-23-we-updated-our-rsa-ssh-host-key/


HOW TO FIX IT

On the system where you are trying to use GitHub (be that CSIL, or your own
machine), you need to locate a file called known_hosts.

The error message will tell you exactly where this file is. For example:

Add correct host key in /Users/pconrad/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/pconrad/.ssh/known_hosts:4


In this case, the location is /Users/pconrad/.ssh/known_hosts line 4.

So, bring up that file in your favorite editor: vim, emacs, VSCode, whatever.

The line you need to delete will look something like this. It may be slightly
different, but it will start with github.com

github.com,192.30.255.113 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==


All you need to do is delete the line that starts with github.com, and leave the
rest of the file alone.

That should fix it, though the first time you connect to github after this,
you’ll get this dialog, to which you need to answer yes:

The authenticity of host 'github.com (192.30.255.112)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? 


This is the dialog that recreates the correct line to put in the known_hosts
file.


A FEW MORE LITTLE SECURITY DETAILS

Should we have just said yes to that dialog? Well, it depends.

There are a few circumstances when you might have said no or fingerprint:

 * If you were truly paranoid
 * If you had actual reason to suspect that you or GitHub were under cyberattack
 * If you were working on an application with very high security needs (e.g.
   nuclear weapons code)

Under those circumstances, you’d get the fingerprint for the GitHub public key
through some means other than an internet connection (e.g. secure courier) and
you’d verify it against the number shown there
SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.

Typically, however, we just trust that the connection is not under active
attack, and we accept the number as valid.

Then, if it later changes—as it did in this case—we verify that it was supposed
to change (as we did, by reading the GitHub blog.) If it wasn’t supposed to
change, then we might really believe that we were being subjected to a so-called
“man-in-the-middle” attack.

--------------------------------------------------------------------------------

Edit this page on GitHub.