From 7113155ba4fd4b000e5f06c50c9a308f64dc6e9c Mon Sep 17 00:00:00 2001 From: CCCITBS <121666248+carligithub400@users.noreply.github.com> Date: Sat, 3 Feb 2024 00:07:50 +0100 Subject: [PATCH] Update README.md --- README.md | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 8eb3ad1..814baa4 100644 --- a/README.md +++ b/README.md @@ -6,50 +6,49 @@ To use the included Bash script to implement a two-factor authentication layer ( ``` bash git clone https://github.com/carligithub400/literate-auth/ ``` - Make sure it has execution rights: - - ``` bash - chmod a+xrw literate-auth/ - ``` - -3. **Set up a Telegram bot:** + +2. **Set up a Telegram bot:** - Create a new Telegram bot by talking to the BotFather on Telegram. Make a note of the token provided. -4. **Get your chat ID:** +3. **Get your chat ID:** - Start a chat with your newly created bot on Telegram. - Visit the following URL and replace `` with your actual bot token: `https://api.telegram.org/bot/getUpdates` - Look for the 'chat' part in the answer. The `id` field in the `chat` object is your chat ID. Make a note of it. -5. **Edit the script:** +4. **Edit the script:** - Open the script in a text editor and replace "token" with your Telegram bot token and "id" with your chat ID. -6. **Run the script:** +5. **Run the script:** - Run the script in your terminal: ``` bash bash literate-auth/main.sh ``` -7. **Follow the directions:** +6. **Follow the directions:** - The script will generate a random 6-digit challenge and send it to your Telegram bot. - You will be asked to enter the challenge answer without the entry being displayed. - Type the correct answer to continue. -8. **Access to the scale:** +7. **Access to the scale:** - If the answer is correct, the script grants access to the `/bin/bash` shell. - If the answer is incorrect, the connection will be disconnected. -9. **Cleanup:** +8. **Cleanup:** - After successful authentication, the script deletes the challenge file. -10. **Create a user and connect to ssh** +9. **Create a user and connect to ssh** - Create a user with the command that has the code main.sh as the default shell. ``` bash sudo adduser $user --shell=$path_main.sh ``` - Change $user with the name of the user and $path_main.sh with the path of the cloned code. + -Make sure it has execution rights: + ``` bash + chmod a+xrw literate-auth/ + ``` - Ssh to the user and if all goes well it will say that you have to enter a code. **Important Considerations:**