SSH Permission Denied on Port 22: A Home Lab Server Issue
In this article, we will be discussing a common issue faced by users who have a home lab server running Ubuntu Server 24.04 LTS. Specifically, we will be looking at the problem of being denied access to the server via SSH, when attempting to connect from a laptop running Windows 10.
The Problem: SSH Permission Denied on Port 22
When trying to connect to a home lab server running Ubuntu Server 24.04 LTS via SSH from a Windows 10 laptop, you may encounter the following error message:
< $ ssh user@server
user@server's password:
Permission denied, please try again.
This error message is indicating that the password you entered is incorrect. However, you are sure that you are entering the correct password. So, what could be the issue?
Understanding SSH and Port 22
Before we can dive into the solution, it's important to understand what SSH and Port 22 are. SSH stands for Secure Shell, and it is a protocol used to securely connect to remote servers. Port 22 is the default port used by SSH for communication between the client and the server.
Why Was Access Denied?
In this scenario, access was denied because the home lab server was recently configured to deny access to the SSH server from the Windows 10 laptop. This was done to enhance the security of the home lab server.
The Solution: Setting Up the SSH Server on the Laptop
To resolve this issue, you need to set up the SSH server on the Windows 10 laptop. This will allow the laptop to act as a client and connect to the home lab server using SSH.
Step 1: Installing the OpenSSH Client on the Laptop
The first step is to install the OpenSSH client on the Windows 10 laptop. This can be done by following these steps:
- Open the Start menu and search for "Turn Windows features on or off"
- Check the box next to "OpenSSH Client" and click "OK"
- Wait for the installation to complete
Step 2: Generating SSH Keys on the Laptop
Once the OpenSSH client is installed, you need to generate SSH keys on the laptop. This can be done by following these steps:
- Open a Command Prompt
- Enter the following command: "ssh-keygen"
- Press Enter to accept the default location for the keys
- Enter a passphrase for the key (optional)
Step 3: Copying the SSH Key to the Home Lab Server
Once the SSH keys are generated, you need to copy the public key to the home lab server. This can be done by following these steps:
- Enter the following command: "ssh-copy-id user@server"
- Enter the user's password on the home lab server
Testing the Connection
After completing the above steps, you can test the connection by entering the following command:
< $ ssh user@server
If everything is set up correctly, you should be able to connect to the home lab server without any issues.
- SSH Permission Denied on Port 22 is a common issue faced by users who have a home lab server running Ubuntu Server 24.04 LTS
- This issue occurs when the home lab server is configured to deny access to the SSH server from a Windows 10 laptop
- To resolve this issue, you need to set up the SSH server on the Windows 10 laptop
- This involves installing the OpenSSH client, generating SSH keys, and copying the public key to the home lab server