# SSH server

{% hint style="danger" %}
Make sure **you've entered the correct IP address** to avoid any connection issues.
{% endhint %}

## Step 1 <a href="#step-1" id="step-1"></a>

To whitelist the IP, open **/etc/hosts.allow** file, enter **GoodAccess Gateway IP/32**, and **Save** the file.

```
sshd: 21.22.23.24/32, 33.34.35.36/32
```

*This line will allow all the comma separated IP blocks to your SSH port*

## Step 2

To block access from all other sources, open **/etc/hosts.deny** file, enter **"ALL"**, and **Save** the file.

```
sshd: ALL
```

{% hint style="info" %}
**Note:** There are several other ways to restrict access to SSH servers like IPTABLES firewall (restrict the access to TCP port 22), or SSH daemon config.
{% endhint %}


---

# 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://support.goodaccess.com/configuration-guides/ip-whitelisting/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.
