> For the complete documentation index, see [llms.txt](https://davidjosearaujo.gitbook.io/online-courses/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://davidjosearaujo.gitbook.io/online-courses/ccna-200-301/secure-shell/ssh.md).

# SSH

SSH (Secure Shell) was developed in 1995 ti replace less secure protocols like Telnet.

SSHv2, a major revisiion of SSHv1, was released in 2006.

If a device supports both version 1 and version2, it is said to run 'version 1.99'.

Provides security features such as data encryption and authentication.

<figure><img src="/files/uTlI8mi8X7Qjtwj0SIvV" alt=""><figcaption></figcaption></figure>

The SSH *server* (the device being connected to) listens for SSH traffic on **TCP port 22**.

## Configuration

<figure><img src="/files/G8mowDd8R2byrmuO4S7b" alt=""><figcaption></figcaption></figure>

IOS images that support SSH will have '**K9**' in their name.

Cisco exports NPE (No Payload Encryption) IOS images to countries that have restrictions on encryption technologies.

NPE IOS images do not support cryptographic features such as SSH.

### RSA keys

To enable and use SSH, you must generate an RSA public and private key pair.

The keys are used for daa encryption/decryption, authentication, etc.

* `ip domain name jeremysitlab.com` -> the **FQDN** of the device is used to name the RSA keys. FQDN = Fully Qualified Domain Name (host name + domain name).
* `crypto key generate rsa` -> generates the RSA keys.
  * `crypto key generate rsa modulus <length>` is and alternate method. Length must be 768 bits or greater for SHHv2.

### VTY Lines

1. `ip ssh version 2` -> (optional, but recommended) restrict SSH to version 2 only.
2. `line vty 0 15` -> configure all VTY lines, just like Telnet.
3. `login local` -> enable local user authentication. You cannot use `login` for SSH, only `login local`.
4. `exec-timeout 5 0` -> (optional, but recommended) configure the exec timeout.
5. `transport input ssh` -> best practice is to limit VTY line connections to SSH only.
6. `access-class 1 in` -> (optional, but recommended) apply the ACL to restrict VTY line connections.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://davidjosearaujo.gitbook.io/online-courses/ccna-200-301/secure-shell/ssh.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.
