https://github.com/bobbyiliev/ssh-2fa
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
https://github.com/bobbyiliev/ssh-2fa
Last synced: 3 months ago
JSON representation
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
- Host: GitHub
- URL: https://github.com/bobbyiliev/ssh-2fa
- Owner: bobbyiliev
- Created: 2017-09-13T09:38:32.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-02T23:02:30.000Z (almost 8 years ago)
- Last Synced: 2025-01-23T10:13:12.474Z (9 months ago)
- Language: Shell
- Size: 3.91 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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 workThat is pretty much it, after that you will be prompted for a password after your actual SSH auth is completed.