<commit_before>#LATCH INSTALATION GUIDE FOR SSH


##PREREQUISITES
* OpenSSH .

* C compilator gcc and make.
For RedHat/CentOS,
```
sudo yum install gcc make
```

* Libraries: (libpam-dev, libcurl-dev, libssl-dev).

Installation in Ubuntu
```
sudo apt-get install libpam-dev libcurl-dev libssl-dev
```
Installation in RedHat/Centos
```
yum install pam-devel libcurl-devel openssl-devel
```

* Libraries (only if GUI is used): tkinter.

For Ubuntu,
```
sudo apt-get install python-tk
```
For RedHat/CentOS,
```
sudo yum install tkinter
```

* To get the **"Application ID"** and **"Secret"**, (fundamental values for integrating Latch in any application), it’s necessary to register a developer account in [Latch's website](https://latch.elevenpaths.com). On the upper right side, click on **"Developer area"**.


##DOWNLOADING THE SSH PLUGIN
* When the account is activated, the user will be able to create applications with Latch and access to developer documentation, including existing SDKs and plugins. The user has to access again to [Developer area](https://latch.elevenpaths.com/www/developerArea), and browse his applications from **"My applications"** section in the side menu.

* When creating an application, two fundamental fields are shown: **"Application ID"** and **"Secret"**, keep these for later use. There are some additional parameters to be chosen, as the application icon (that will be shown in Latch) and whether the application will support OTP  (One Time Password) or not.

* From the side menu in developers area, the user can access the **"Documentation & SDKs"** section. Inside it, there is a **"SDKs and Plugins"** menu. Links to different SDKs in different programming languages and plugins developed so far, are shown.


##INSTALLING THE PLUGIN IN SSH
* Go to **"python"** directory in plugin package, open and edit **"latch-model.conf"** file. Add **"Application ID"** and **"Secret"** data, generated previously and save it in the same directory as **"latch.conf"**.

* Cd to the top-level directory of the plugin, and use the **"sudo ./install"** command to install it.

* Restart ssh service.

For Ubuntu,
```
sudo service ssh restart
```
For RedHat/CentOS,
```
sudo service sshd restart
```

* For pairing from command line, use "pairSSH + TOKEN GENERATED BY LATCH" command. From a console, execute "latchSSH".

* For pairing from command line, use "unpairSSH" command. From a console, execute "latchSSH".

##UNINSTALLING THE PLUGIN IN SSH
* Open a terminal. Move to **"python"** directory. Run **"sudo python uninstall.py"**.

* Linux Restart SSH

For Ubuntu,
```
sudo service ssh restart
```
For RedHat/CentOS,
```
sudo service sshd restart
```


##USE OF LATCH MODULE FOR THE USERS
**Latch does not affect in any case or in any way the usual operations with an account. It just allows or denies actions over it, acting as an independent extra layer of security that, once removed or without effect, will have no effect over the accounts, which will remain with their original state.**

The user needs the Latch application installed on the phone, and follow these steps:

* **Step 1:** There are two options:
    * Option A. Pairing with command line: Just open a console and execute **“pairSSH + TOKEN GENERATED BY LATCH”**.
    * Option B. Pairing with GUI: In a console, execute **“latchSSH”**. A new windows will appear. Pressing on **“Pair”**, a new window will appear, where the user may introduce the token generated by the mobile app.

* **Step 2:** From the Latch app on the phone, the user has to generate the token, pressing on **“generate pairing code to add service"** at the bottom of the application.

* **Step 3:** The user has to type the characters generated on the phone into the text box displayed on the web page. Click on **"OK"** button.

* **Step 4:** Now the user may lock and unlock the account, preventing any unauthorized access.<commit_msg>Updated and improved README<commit_after># LATCH SSH PLUGIN
The safety switch for your digital life

## Installation guide for SSH

### Prerequisites
* OpenSSH.

* C compilator gcc and make.

  For Ubuntu/Debian
  ```
  sudo apt-get install gcc make
  ```

  For RedHat/CentOS,
  ```
  sudo yum install gcc make
  ```

* Libraries: (libpam0g-dev, libcurl4-openssl-dev, libssl-dev).

  For Ubuntu/Debian
  ```
  sudo apt-get install libpam0g-dev libcurl4-openssl-dev libssl-dev
  ```

  For RedHat/Centos
  ```
  sudo yum install pam-devel libcurl-devel openssl-devel
  ```

* Libraries (only if GUI is used): tkinter.

  For Ubuntu/Debian,
  ```
  sudo apt-get install python-tk
  ```

  For RedHat/CentOS,
  ```
  sudo yum install tkinter
  ```

* To get the **"Application ID"** and **"Secret"**, (fundamental values for integrating Latch in any application), it’s necessary to register a developer account in [Latch's website](https://latch.elevenpaths.com). On the upper right side, click on **"Developer area"**.


### Downloading the SSH plugin
* When the account is activated, the user will be able to create applications with Latch and access to developer documentation, including existing SDKs and plugins. The user has to access again to [Developer area](https://latch.elevenpaths.com/www/developerArea), and browse his applications from **"My applications"** section in the side menu.

* When creating an application, two fundamental fields are shown: **"Application ID"** and **"Secret"**, keep these for later use. There are some additional parameters to be chosen, as the application icon (that will be shown in Latch) and whether the application will support OTP  (One Time Password) or not.

* From the side menu in developers area, the user can access the **"Documentation & SDKs"** section. Inside it, there is a **"SDKs and Plugins"** menu. Links to different SDKs in different programming languages and plugins developed so far, are shown.


### Installing the plugin in SSH
* Go to **"python"** directory in plugin package, open and edit **"latch-model.conf"** file. Add **"Application ID"** and **"Secret"** data, generated previously and save it in the same directory as **"latch.conf"**.

* Cd to the top-level directory of the plugin, and use the **"sudo ./install"** command to install it.

* Restart ssh service.

  For Ubuntu/Debian,
  ```
  sudo service ssh restart
  ```

  For RedHat/CentOS,
  ```
  sudo service sshd restart
  ```

* For pairing from command line, use "pairSSH + TOKEN GENERATED BY LATCH" command. From a console, execute "latchSSH".

* For pairing from command line, use "unpairSSH" command. From a console, execute "latchSSH".


### Uninstalling the plugin in SSH
* Open a terminal. Move to **"python"** directory. Run **"sudo python uninstall.py"**.

* Linux Restart SSH

  For Ubuntu/Debian,
  ```
  sudo service ssh restart
  ```

  For RedHat/CentOS,
  ```
  sudo service sshd restart
  ```


### Use of LATCH module for the users
**Latch does not affect in any case or in any way the usual operations with an account. It just allows or denies actions over it, acting as an independent extra layer of security that, once removed or without effect, will have no effect over the accounts, which will remain with their original state.**

The user needs the Latch application installed on the phone, and follow these steps:

* **Step 1:** There are two options:
    * Option A. Pairing with command line: Just open a console and execute **“pairSSH + TOKEN GENERATED BY LATCH”**.
    * Option B. Pairing with GUI: In a console, execute **“latchSSH”**. A new windows will appear. Pressing on **“Pair”**, a new window will appear, where the user may introduce the token generated by the mobile app.

* **Step 2:** From the Latch app on the phone, the user has to generate the token, pressing on **“generate pairing code to add service"** at the bottom of the application.

* **Step 3:** The user has to type the characters generated on the phone into the text box displayed on the web page. Click on **"OK"** button.

* **Step 4:** Now the user may lock and unlock the account, preventing any unauthorized access.
{'fraction_non_alphanumeric': 0.09877308216631553, 'fraction_numerical': 0.0014871731317387532, 'mean_word_length': 4.233463035019455, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1932812', 'n_tokens_mistral': 2395, 'n_tokens_neox': 2224, 'n_words': 1138}