Tag: GitHub

Error “remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead” (SOLVED)

The article “How to make and submit changes to source code on GitHub” shows you how to update files on GitHub after you have edited their local copies on your computer. The commands shown in the article are still valid, but due to changes on GitHub, now instead of a password, you need to use a token that you need to get on GitHub itself.

When trying to use a password for authentication, you will encounter an error:

remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Authentication failed for 'https://github.com/Mi-Al/OpenVPNassistent/'

The essence of the error is that since August 13, 2021, support for password authentication has been removed and now you need to use a token.

There is also a link to read the details: https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/

From that link, you will need to go to another page, where they will still explain how to get a token: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal -access-token

You can check out these pages. But the gist is pretty simple, go to https://github.com/settings/tokens page and click on the “Generate new token” button.

Enter “Note”, the actual name, for the token.

Set the token expiration time.

It is highly recommended not to make perpetual tokens, but even if your perpetual token has been stolen, you can revoke it at any time, that is, invalidate it.

Select the scope of the token. For the “git push” command, you need to select “repo”, as stated in the description, this is “Full control of private repositories”.

Please note that the token will only be shown once – don't forget to copy it!

If you forgot to copy or lost it, it doesn't matter, you can always re-generate a token or create a new one.

Use the token in the same way as you used the password. That is, when prompted for a password when submitting changes to GitHub, enter the token, not the password.

How to make and submit changes to source code on GitHub

GitHub is an awesome collaborative software development tool. There is a lot of documentation on working with git: in the program's help and on the Internet.

Being very flexible and with many commands and options, git can be confusing when you first get to know it. The git options and commands should be studied carefully, but this post is a dirty and short guide that shows you step by step how to make changes to a program hosted on GitHub and how to submit your changes to the author.

Before sending your changes to the code to the author of the program, it is strongly recommended that you familiarize yourself with his wishes. They can be associated with both programming style (specifics of naming variables, for example) and formatting features (using the tab key or four spaces, for example). Even if the author did not write their wishes, it is highly recommended to follow the style of the code you are editing.

Source code edit permission on GitHub

The procedure for changing the source code on GitHub differs depending on whether you have the permission to change the source code of a repository or not.

You can directly edit a repository on GitHub in the following cases:

  • you are the owner of the repository
  • you are granted permissions to edit a specific repository by its owner

In this case, the editing procedure is as follows:

  • you clone the source code to your local computer
  • make changes to the source code
  • push changes to the repository

If you do not have permission to edit the repository, but want to suggest a change to the source code, then you need to Fork the original repository.

Next, you go through three familiar stages for your fork:

  • you clone the source code to your local computer
  • make changes to the source code
  • push changes to the repository

After that, you submit changes to the original repository, this is called “Pull request”.

How to edit source code on GitHub

I'll show you part of a real workflow on real code here.

Situation: in the airgeddon program in the EvilTwin branch, I need to make changes to some lines. I start by cloning the code to my local drive:

git clone https://github.com/v1s1t0r1sh3r3/airgeddon.git -b EvilTwin

Note that I am using the -b switch, followed by the name of the EvilTwin branch. By default, the newest branch is cloned (the branch in which the most recent changes were made). Since the default name is master, this is usually the branch that is cloned.

The names of branches and features of the workflow can be different for each project – and they are discussed within the team or available in the form of public rules.

The source code can be edited in your favorite editor or IDE. After completing the edits, on the command line, go to the directory with the program and execute there:

git status

Information about the status (file changed) and tips on what to do next are displayed:

Add the file(s) in which the changes were made:

git add airgeddon.sh

And again we look at the status:

git status

We need to write a comment on what we did with the code:

git commit -m "Updating Russian translation (minor fixes)"

We get approximately the following information:

[EvilTwin 39b8960] Updating Russian translation (minor fixes)
 1 file changed, 8 insertions(+), 8 deletions(-)

If you're curious, you can see the status again:

git status

The information received and the hint indicate that everything is ready to send our changes to GitHub. To do this, I execute the command (EvilTwin in this case is the name of the branch to which I am committing):

git push origin EvilTwin

You will be asked for your username (e-mail) and password on GitHub and the following information will be displayed:

Подсчет объектов: 3, готово.
Delta compression using up to 3 threads.
Сжатие объектов: 100% (3/3), готово.
Запись объектов: 100% (3/3), 420 bytes | 0 bytes/s, готово.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
To https://github.com/v1s1t0r1sh3r3/airgeddon.git
   04d1fb4..39b8960  EvilTwin -> EvilTwin

PLEASE NOTE: Since August 13, 2021, support for password authentication has been removed and now you need to use a token. For details, see Error “remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead” (SOLVED).

Finally, you can check the status again:

git status
Loading...
X