Unable to Establish SSH Connection from Windows 10 to Ubuntu 22.04 Guest with Non-Admin Account

Abstract: Resolve SSH connection failures from Windows 10 to Ubuntu 22.04 by enabling password authentication and verifying user permissions in sshd_config.

Created: 2026-09-22 by

SSH connection failures from a Windows 10 host to an Ubuntu 22.04 guest typically stem from the Ubuntu user account lacking SSH access permissions or the sshd service rejecting password-based authentication for non-root users. To resolve this, verify that the target user is in the sudo group, ensure PasswordAuthentication yes is set in /etc/ssh/sshd_config, and confirm the SSH service is active and listening on port 22 within the virtual network.

Diagnosing the Connection Failure

When attempting to connect via SSH from Windows 10 using PowerShell or PuTTY, you may encounter errors such as "Connection refused," "Permission denied (publickey,password)," or timeouts. It is critical to distinguish between network-level failures and authentication failures. A "Connection refused" error usually indicates that the SSH daemon (sshd) is not running or is blocked by a firewall. Conversely, authentication errors suggest that the service is reachable but rejects the login credentials due to configuration restrictions. First, ensure that the Ubuntu guest VM is powered on and has an active network interface. If you are using VirtualBox, check the network adapter settings. The most common configuration for host-guest communication is NAT or Bridged Adapter. In a NAT setup, port forwarding must be configured to map a host port to the guest's port 22. For bridged connections, the guest receives an IP address on your local network, allowing direct SSH access using that IP. You can find the guest's IP address by running ip addr show inside the Ubuntu terminal. If the network path is clear, the issue likely lies within the Ubuntu system configuration. The term "non-admin account" in this context refers to the user account on the Ubuntu guest operating system, not the Windows host administrator account. Linux does not use the concept of "admin" accounts in the same way Windows does; instead, it relies on user groups and file permissions. By default, new user accounts may not have the necessary privileges to log in via SSH if specific configurations are missing.

Verifying SSH Service Status

Before modifying user permissions, confirm that the SSH server is installed and running on Ubuntu 22.04. Open a terminal in the Ubuntu guest and execute the following command:
systemctl status ssh
If the service is inactive or failed, start it with:
sudo systemctl enable --now ssh
This command ensures that the SSH service starts automatically upon boot and begins immediately. Check the output for any error messages. If the service fails to start, review the logs using journalctl -u ssh for detailed diagnostics. Once the service is active, verify that it is listening on the correct port by running:
sudo ss -tlnp | grep :22
You should see a line indicating that sshd is listening on port 22. If no output appears, the service may not be bound to the correct interface, or another application might be occupying the port.

Configuring User Permissions and Authentication

The core issue often involves how Ubuntu handles authentication for standard users. By default, Ubuntu 22.04 may disable password authentication in favor of key-based authentication for security reasons. If you are trying to log in with a username and password, you must explicitly enable this option in the SSH configuration file. Edit the SSH daemon configuration file using a text editor with sudo privileges:
sudo nano /etc/ssh/sshd_config
Search for the line containing PasswordAuthentication. It may be commented out with a hash symbol (#). Change it to:
PasswordAuthentication yes
Additionally, ensure that PermitRootLogin is set according to your security needs, though this affects root access rather than non-admin users. After making changes, restart the SSH service to apply them:
sudo systemctl restart ssh
Next, verify that the non-admin user account exists and has a valid shell. Run:
getent passwd username
Replace username with the actual account name. This command should return details about the user, including their home directory and shell path (typically /bin/bash). If the user does not exist, create it using:
sudo adduser username
Ensure the user is added to the sudo group if administrative privileges are required later, although this is not strictly necessary for SSH login:
sudo usermod -aG sudo username

Firewall and Network Considerations

Ubuntu comes with ufw (Uncomplicated Firewall) enabled by default. Even if sshd is running, the firewall may block incoming SSH connections. Check the firewall status with:
sudo ufw status
If the status is active, allow SSH traffic by running:
sudo ufw allow ssh
This rule permits incoming connections on port 22. If you have customized the SSH port, replace ssh with tcp/[port_number]. After updating the firewall rules, test the connection again from the Windows 10 host. For VirtualBox users, if you are using NAT networking, you must configure port forwarding. Go to the VM settings, select Network, then Advanced, and click Port Forwarding. Add a new rule mapping Host Port 2222 (or another available port) to Guest IP [IP Address] and Guest Port 22. From Windows, connect using:
ssh -p 2222 username@localhost
This approach bypasses potential IP conflicts and ensures that the host can reach the guest through the VirtualBox hypervisor interface.

Security Best Practices

While enabling password authentication resolves immediate connectivity issues, it exposes your system to brute-force attacks. It is highly recommended to switch to key-based authentication once connectivity is established. Generate an SSH key pair on your Windows 10 machine using PowerShell:
ssh-keygen -t ed25519
Copy the public key to the Ubuntu guest using:
ssh-copy-id username@ubuntu_ip_address
After verifying that you can log in using the key, disable password authentication in /etc/ssh/sshd_config by setting PasswordAuthentication no. This significantly enhances the security posture of your virtual environment. Understanding VirtualBox Linked Clones for Windows 10 provides additional context on managing VM states, which can help if you need to reset configurations quickly. Similarly, How to prevent Windows 10 from creating random new network adapters ensures stable network interfaces, reducing ambiguity when troubleshooting IP addresses.

Frequently Asked Questions

Why does SSH work with the root user but not my regular user?

By default, many Linux distributions restrict root login via SSH for security, but they may also misconfigure user permissions. Ensure your regular user has a valid shell assigned in /etc/passwd and that the home directory has correct ownership. If the user lacks a password set via passwd, password authentication will fail even if enabled.

Can I use SSH keys instead of passwords for non-admin users?

Yes, key-based authentication is the preferred method for all users, regardless of privilege level. It is more secure than passwords and avoids issues related to password complexity requirements or expired credentials. Set up keys by copying the public key from the Windows host to the ~/.ssh/authorized_keys file on the Ubuntu guest.

What if I get a "Host Key Verification Failed" error?

This error occurs when the SSH client detects a change in the host key fingerprint, often after reinstalling the OS or changing network configurations. Remove the old entry from your Windows known_hosts file located at C:\Users\YourUsername\.ssh\known_hosts and reconnect to accept the new key.

Does disabling password authentication break access for non-admin users?

No, disabling PasswordAuthentication only affects password-based logins. Users who have properly configured SSH keys can still log in securely. However, if a user has not set up keys, they will be locked out. Always ensure key-based access is working before disabling passwords.

How do I check if my Ubuntu user account is locked?

A locked account prevents all login attempts. Use the command passwd -S username to check the status. If it shows "L" (locked), unlock it with sudo passwd -u username. This is distinct from permission issues and directly impacts SSH accessibility.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More