> For the complete documentation index, see [llms.txt](https://weihanglo.gitbook.io/debian-server-for-r-computing/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://weihanglo.gitbook.io/debian-server-for-r-computing/software/software_openssh.md).

# OpenSSH

## Installation

Secure shell is an encrypted network protocol that allow remote login securly. If you have no idea what Secure Shell is, read [this](https://en.wikipedia.org/wiki/Secure_Shell) before we start.

Normally the client and server are installed by default. If not it suffices to run:

```bash
$ sudo apt-get update
$ sudo apt-get install openssh-client openssh-server
```

## Simple Configuration

The main configuration files are in the directory **/etc/ssh**:

**ssh\_config** : client configuration file **sshd\_config** : server configuration file

We will only cover the server configuration in this manual.

* Open **/ect/ssh/sshd\_config** for editing.

  ```bash
  $ sudo vim /etc/ssh/sshd_config
  ```
* For security, change the listening port instead of default TCP port 22 as such:

  ```bash
  Port 10022
  ```
* Ensure that **PermitRootLogin** is set to **no** in sshd\_config (we use sudo-user only):

  ```bash
  PermitRootLogin no
  ```
* Start your SSH service.

  ```bash
  $ sudo /etc/init.d/ssh start
  ```

***NOTE:** After any configuration, always restart server to apply your changes.*

```bash
$ sudo /etc/init.d/ssh restart
```
