Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
carligithub400 authored Feb 2, 2024
1 parent 9904de5 commit 7113155
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<YOUR_BOT_TOKEN>` with your actual bot token: `https://api.telegram.org/bot<YOUR_BOT_TOKEN>/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:**
Expand Down

0 comments on commit 7113155

Please sign in to comment.