To remotely connect from Windows to an Ubuntu server using SSH, you need to install and enable the OpenSSH Server on Ubuntu, then connect using PowerShell or Windows Terminal.
Here is a step-by-step guide.
1. Configure SSH Server on Ubuntu
First, log in to your Ubuntu server locally or through its console.
Step 1: Install OpenSSH Server
sudo apt update
sudo apt install openssh-server -y
Step 2: Start and enable SSH
sudo systemctl enable ssh
sudo systemctl start ssh
Step 3: Check SSH service status
sudo systemctl status ssh
Expected status:
Active: active (running)
Step 4: Check Ubuntu IP address
ip addr
Or:
hostname -I
Example:
192.168.100.10
Step 5: Check SSH listening port
sudo ss -tlnp | grep ssh
Default SSH port:
22
2. Configure Ubuntu Firewall (UFW)
If UFW is enabled, allow SSH:
sudo ufw allow 22/tcp
Check firewall:
sudo ufw status
Expected:
22/tcp ALLOW Anywhere
3. Connect from Windows
Windows 10 and Windows 11 already include an OpenSSH client in most installations.
Open PowerShell or Windows Terminal.
Run:
ssh username@192.168.100.10
For example:
ssh administrator@192.168.100.10
The first connection may show:
The authenticity of host can’t be established.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
Type:
yes
Enter your Ubuntu user’s password.
You should now have a remote Ubuntu terminal.
4. Useful SSH Commands
| Task | Command |
| Connect to Ubuntu | ssh user@IP |
| Connect using custom port | ssh -p 2222 user@IP |
| Disconnect | exit |
| Copy file to Ubuntu | scp file.txt user@IP:/home/user/ |
| Copy file from Ubuntu | scp user@IP:/home/user/file.txt . |
| Check SSH version | ssh -V |
| Test SSH connectivity | Test-NetConnection IP -Port 22 |
5. (Recommended) Configure SSH Key Authentication
For a SysAdmin environment, I recommend using SSH keys instead of passwords.
On Windows PowerShell:
Generate an SSH key:
ssh-keygen -t ed25519
Press Enter to accept the default location.
Copy the public key:
Get-Content $env:USERPROFILE\.ssh\id_ed25519.pub
Copy the displayed public key.
On Ubuntu:
Create the SSH directory:
mkdir -p ~/.ssh
chmod 700 ~/.ssh
Add the public key:
nano ~/.ssh/authorized_keys
Paste your Windows public key, save, then:
chmod 600 ~/.ssh/authorized_keys
Connect again from Windows:
ssh username@192.168.100.10
You should now be able to authenticate using your SSH key.
6. Troubleshooting
| Error | Possible solution |
| Connection refused | Check systemctl status ssh |
| Connection timed out | Check network connectivity and firewall |
| Permission denied | Verify username, password, or SSH key |
| No route to host | Check routing, VLAN and IP connectivity |
| Port 22 unavailable | Check SSH configuration and listening port |
Test connectivity from Windows:
Test-NetConnection 192.168.100.10 -Port 22
Look for:
TcpTestSucceeded : True
7. Recommended Setup for Your IT Environment
For your Ubuntu infrastructure (192.168.100.0/24), I recommend this configuration:
| Component | Configuration |
| SSH Server | OpenSSH |
| SSH Port | 22 (or custom port if required) |
| Authentication | SSH Key |
| Firewall | UFW |
| Remote Client | Windows Terminal |
| Automation | Ansible |
| Monitoring | Zabbix |
Security recommendation: If SSH is exposed beyond your trusted network, use VPN access, disable password authentication after validating key access, and restrict SSH access using firewall rules.