GithubHelp home page GithubHelp logo

bobbyiliev / ssh-2fa Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 4 KB

This is a simple bash script that works as a 2FA for Shell access, you can use it on shared hosting platforms where you do not have root/sudo access

Shell 100.00%

ssh-2fa's Introduction

ssh-2FA

This is a simple bash script that kind of works as a 2FA for SSH. The good thing about the script is that you can use it on shared hosting platforms where you do not have root/sudo access.

This has been tested on CentOS servers.

Be careful when setting your password so that you do not lock your self out

In order to set that it up just follow these steps here:

  1. Upload the file to your home folder
  2. Change the password in the script to the password that you would like to use
  3. Make the file executable (chmod +x 2fa.sh)
  4. To test the script just run it and check if you can authenticate as normal (Just run ./2fa) . If that works proceed to the next step
  5. Add the following line in your ~/.bashrc file (Note, update the path accordingly)
   . /path/to/the/file/2fa.sh

Note! The dot before the /path/ is very important as that way you will be running the script in the same shell! Without the dot the script would not work

That is pretty much it, after that you will be prompted for a password after your actual SSH auth is completed.

ssh-2fa's People

Contributors

bobbyiliev avatar

Stargazers

Daniel Ling avatar  avatar salah731 avatar

Watchers

James Cloos avatar  avatar

Forkers

choirrulloh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.