Skip to content

instruction how to change from https to ssh

Thomas Reerink edited this page Feb 18, 2021 · 2 revisions

Those who used (because they followed the default ece2cmor3 checkout instruction):

 git clone https://github.com/EC-Earth/ece2cmor3.git

get a warning message with the subject [GitHub] Deprecation Notice since January 2021, reading:

Hi @treerink,

You recently used a password to access the repository at EC-Earth/ece2cmor3 with git using git/2.17.1.

Basic authentication using a password to Git is deprecated and will soon no longer work. Visit https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information around suggested workarounds and removal dates.

Thanks,
The GitHub Team

One can migrate from https to ssh by:

# Check whether the file ~/.ssh/id_rsa.pub already exists, if so, skip the next line.
 ssh-keygen -t rsa                                                # Only if ~/.ssh/id_rsa.pub not exists yet
 cat ~/.ssh/id_rsa.pub                                            # Add this key to your Github SSH keys at https://github.com/settings/keys
 git remote -v                                                    # Shows that you currently use https
 git remote set-url origin git@github.com:EC-Earth/ece2cmor3.git  # Migrates https to ssh
 git remote -v                                                    # Shows that you now use the ssh clone
 git pull                                                         # In order to test whether everything works fine (without passwords now)

One can also have a look here at stackoverflow.

Clone this wiki locally