# Configuring SSH and HTTPS Management Access
Secure management access is essential for network devices to ensure that unauthorized users cannot access or manipulate device configurations. This tutorial will walk you through the steps required to configure Secure Shell (SSH) for command-line management and HTTPS for web-based management on a Cisco router or switch.
## Table of Contents
1. **Prerequisites**
2. **Configure SSH Access**
- Step 1: Set Hostname and Domain Name
- Step 2: Generate RSA Keys
- Step 3: Configure SSH Version
- Step 4: Create a User Account
- Step 5: Configure SSH Access Settings
- Step 6: Test SSH Access
3. **Configure HTTPS Access**
- Step 1: Enable the Web Server
- Step 2: Generate a Self-Signed Certificate
- Step 3: Configure HTTPS Settings
- Step 4: Test HTTPS Access
4. **Verification**
5. **Conclusion**
---
## 1. Prerequisites
- Access to a Cisco router or switch.
- Basic knowledge of Cisco IOS commands.
- Console access to the device for initial configuration.
---
## 2. Configure SSH Access
### Step 1: Set Hostname and Domain Name
First, you need to set the device's hostname and domain name. These settings are necessary for generating SSH keys.
```plaintext
Router# configure terminal
Router(config)# hostname MyRouter
MyRouter(config)# ip domain-name mydomain.com
```
### Step 2: Generate RSA Keys
Next, generate RSA keys for SSH. You can specify the key length; 2048 bits is recommended for security.
```plaintext
MyRouter(config)# crypto key generate rsa
The name for the keys will be: MyRouter.mydomain.com
How many bits in the modulus [512]: 2048
```
### Step 3: Configure SSH Version
Set the SSH version to 2 for enhanced security features.
```plaintext
MyRouter(config)# ip ssh version 2
```
### Step 4: Create a User Account
Create a user account that will be used to log in via SSH. You can use the `secret` option to encrypt the password.
```plaintext
MyRouter(config)# username admin privilege 15 secret StrongPassword
```
### Step 5: Configure SSH Access Settings
Enable SSH access on the virtual terminal (VTY) lines. Ensure that you configure timeout settings and login authentication.
```plaintext
MyRouter(config)# line vty 0 15
MyRouter(config-line)# transport input ssh
MyRouter(config-line)# login local
MyRouter(config-line)# exec-timeout 5 0 (timeout after 5 minutes of inactivity)
MyRouter(config-line)# exit
```
### Step 6: Test SSH Access
From another device (e.g., a computer with SSH client), test the SSH connection.
```plaintext
ssh admin@<Router_IP_Address>
```
Enter the password when prompted. If successful, you should gain access to the router's CLI.
---
## 3. Configure HTTPS Access
### Step 1: Enable the Web Server
You need to enable the HTTP server on the device to allow HTTPS management access.
```plaintext
MyRouter(config)# ip http server
MyRouter(config)# ip http secure-server
```
### Step 2: Generate a Self-Signed Certificate
Generate a self-signed SSL certificate, which will be used to encrypt the HTTPS traffic.
```plaintext
MyRouter(config)# ip http secure-certificate self-signed
```
You will be prompted to provide information such as the country, state, city, organization name, and validity period.
### Step 3: Configure HTTPS Settings
Set the authentication method for HTTPS to ensure secure connections.
```plaintext
MyRouter(config)# ip http authentication local
```
### Step 4: Test HTTPS Access
Open a web browser on a computer and navigate to the following URL:
```plaintext
https://<Router_IP_Address>
```
You may see a warning about the self-signed certificate; you can proceed past this warning. Log in using the credentials you set up earlier (username: admin, password: StrongPassword).
---
## 4. Verification
To verify the configuration of SSH and HTTPS access, you can use the following commands:
### Verify SSH Configuration
```plaintext
MyRouter# show ip ssh
```
This command will show you the SSH version and other related settings.
### Verify HTTPS Configuration
```plaintext
MyRouter# show ip http server status
```
This command will show whether the HTTP and HTTPS servers are enabled and running.
---
## 5. Conclusion
You have successfully configured SSH and HTTPS management access on your Cisco router or switch. Using SSH provides secure command-line access, while HTTPS allows secure web-based management. Always ensure that your passwords are strong and consider further hardening your device for added security.
By following this tutorial, you should now be equipped to manage your Cisco devices securely. If you have any questions or run into issues, feel free to ask!
---
This tutorial should provide a solid foundation for configuring secure management access on Cisco devices. Let me know if you need any additional information or clarification on any specific sections!
Rate This Article
Thanks for reading: Configuring SSH and HTTPS Management Access Tutorial, Sorry, my English is bad:)