# Enable SSH Server

Sometimes, we need to access our machine remotely, and that is where SSH (Secure Shell) comes into play. Enabling SSH Server on Ubuntu is straightforward, we just need to have `openssh-server` package installed which we can install by -

### Install SSH Server

```bash
sudo apt-get update
sudo apt-get install -y openssh-server
```

To check whether or not the SSH Server is running run -

```bash
sudo systemctl status ssh
```

### Open port for SSH Server in Firewall

```bash
sudo ufw allow ssh
```

## Connecting to SSH Server

```bash
ssh {USER}@{MACHINE_IP}
```

**Note:** In case `ssh` command is not available, one need to install `openssh-client` package.

***Source:*** [***Linuxize***](https://linuxize.com/post/how-to-enable-ssh-on-ubuntu-20-04/)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://til.devjugal.com/linux/enable-ssh-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
