Skip to content

πŸ‘¨β€πŸ’» An insanely practical bash script that resets a users two-factor by knowing their username or e-mail πŸ”₯

Notifications You must be signed in to change notification settings

Am0rphous/Reset-2FA-Gitlab-Script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Reset 2FA - GitLab

An insanely practical shell script that resets a GitLab users two-factor by only knowing their username or email. This implies you are an admin, and that your token has the scope api and possibly sudo (but correct me if I'm wrong). Inspo

  1. Download the script to your computer.
  2. Write your GitLab URL and your token in the 2fa.sh script.
  3. Open Terminal nad navigate to where the script is located and run:
bash 2fa.sh <username>             #option 1
bash 2fa.sh <[email protected]>    #option 2
sh 2fa.sh mike                     #option 1 with example user name
sh 2fa.sh [email protected]            #option 2 with example e-mail

If the user already has their 2fa disabled, the API returns following message, and you can of course ignore it and move on:

{"message":"400 Bad request - Two-factor authentication is not enabled for this user"}

About

πŸ‘¨β€πŸ’» An insanely practical bash script that resets a users two-factor by knowing their username or e-mail πŸ”₯

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages