Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emtudo/two-factors-ssh
Segurança: SSH - Verificação em duas etapas
https://github.com/emtudo/two-factors-ssh
Last synced: about 23 hours ago
JSON representation
Segurança: SSH - Verificação em duas etapas
- Host: GitHub
- URL: https://github.com/emtudo/two-factors-ssh
- Owner: emtudo
- Created: 2015-08-29T14:49:24.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-08-30T16:28:56.000Z (about 9 years ago)
- Last Synced: 2023-03-02T01:47:05.630Z (over 1 year ago)
- Size: 121 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[Vídeo tutorial](http://youtu.be/W3o4VlEy2aY)
#Fonte:
```
#!/bin/bash
control_c () {
echo -e "\nControl + c acionado.\n"
#pkill -kill -u $USUARIO
exit 0;
}trap control_c INT HUP TERM
if [[ $(who am i) =~ \((\:0\))$ ]]; then
/bin/bash
exit;
fiUSUARIO=`whoami`;
SECRET="123123";#Seu webservice aqui
VALID_TOKEN=`curl http://asterisk.reis/api/sms/sendtoken/6`TAMANHO=${#VALID_TOKEN};
NO_TOKEN="-";if [[ "$VALID_TOKEN" == "$NO_TOKEN" || "$TAMANHO" -gt 6 ]]; then
echo "Failed to send the token";
stty -echo;
VALID_TOKEN=$SECRET;
fiecho "Please enter the token:"
read TOKEN;
stty echo;if [ "$TOKEN" == "secret" ]; then
VALID_TOKEN=$SECRET;
echo "Please enter the password:"
stty -echo;
read TOKEN;
stty echo;
fiif [ "$TOKEN" == "$VALID_TOKEN" ]; then
echo "You have access!"
/bin/bash
exit;
fiecho "ACCESS DENIED!"
#pkill -kill -u $USUARIO
exit;```