How to Connect to Ubuntu from Windows With SSH and SFTP

Use SSH for an Ubuntu terminal and SFTP for graphical file transfers. Install OpenSSH Server on Ubuntu; current Windows 10 and 11 include an OpenSSH client for PowerShell or Windows Terminal. WinSCP uses the same SSH service for file access.

These steps assume both computers share a local network or trusted VPN. For remote access, use a VPN or approved provider rules; avoid exposing SSH publicly. Terminal output and Settings labels can vary by release.

Prepare Ubuntu for SSH

  1. Find the Ubuntu username and address. On Ubuntu, open Terminal and run whoami for the account name and hostname -I for network addresses. Note the private LAN address for your active connection, such as 192.168.1.25. For a managed server, ask its administrator for the correct host name or address.
    Ubuntu terminal showing the signed-in user alex and the computer’s private network address, 192.168.1.25.
    On Ubuntu, note the account name and LAN address you will enter in Windows.
  2. Install the OpenSSH server. In the Ubuntu terminal, update the package list and install the server package:
    sudo apt update
    sudo apt install openssh-server
    Ubuntu documents openssh-server as the package for accepting SSH connections. APT reports if it is already current.
    Ubuntu terminal running apt update and installing the OpenSSH server package.
    Install OpenSSH Server on the Ubuntu computer.
  3. Check the service and firewall. Verify that SSH is running:
    systemctl status ssh
    Look for active (running); if stopped, run sudo systemctl start ssh. Check sudo ufw status. If UFW is active, allow SSH with sudo ufw allow OpenSSH or sudo ufw allow 22. A cloud server may also need an inbound SSH rule in its provider firewall. Do not change remote firewall rules until you know they will preserve access.
    Ubuntu terminal showing the SSH service as active and the UFW command to allow OpenSSH.
    Confirm the SSH service is active; allow SSH through UFW only if that firewall is enabled.

Connect from Windows with PowerShell

  1. Confirm that the Windows SSH client is installed. Open PowerShell or Windows Terminal and run ssh -V. If ssh is missing, search Settings for Optional features, add OpenSSH Client, and install it. The menu is under Apps on some Windows 10 builds and System on Windows 11.
    Windows PowerShell displaying the output of ssh -V.
    Check that the Windows OpenSSH client is available.
  2. Start the connection. In PowerShell, enter ssh username@address, replacing both values with the Ubuntu account and address from step 1. For example:
    ssh alex@192.168.1.25
    For a nonstandard SSH port, add -p, for example ssh -p 2222 alex@192.168.1.25.
    Windows PowerShell with the command ssh alex@192.168.1.25 ready to run.
    Connect using the Ubuntu username and address.
  3. Verify the server’s host key on the first connection. SSH displays an authenticity warning and fingerprint. Verify it with the administrator or on Ubuntu using sudo ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub. If it matches, type yes. If it differs or cannot be verified, stop and check the server address.
    PowerShell displaying the first-connection SSH host key fingerprint prompt.
    Verify the host key before trusting a new SSH server.
  4. Sign in and use the remote shell. Enter the Ubuntu password; no characters appear as you type. The remote shell prompt confirms login. Commands now run on Ubuntu, so check the prompt before using administrative commands.
    PowerShell connected to Ubuntu and showing the remote shell prompt.
    After authentication, PowerShell accepts commands in the remote Ubuntu shell.
  5. Disconnect when finished. Type exit and press Enter to close the SSH session and return to the Windows prompt.
    PowerShell showing exit closing the SSH session and returning to the Windows prompt.
    Type exit to close the remote session.

Browse Ubuntu files from Windows with SFTP

Windows File Explorer’s older ftp:// workflow requires a separate FTP service and does not use the SSH connection above. Use SFTP instead: it transfers files through SSH’s encrypted connection. WinSCP is a Windows client that supports SFTP and provides a two-pane file manager.

  1. Install WinSCP and select SFTP. Download WinSCP from its official site. In the Login window, select SFTP as the file protocol.
    WinSCP login window with SFTP selected and empty host and user fields.
    Open WinSCP and select SFTP for the file protocol.
  2. Enter the Ubuntu connection details. Enter the Ubuntu IP or host name, port 22 (unless changed), and account credentials, then select Login. If passwords are disabled, configure your SSH key in WinSCP’s advanced session settings.
    WinSCP SFTP login form filled with Ubuntu address 192.168.1.25, port 22, and user alex.
    Enter the Ubuntu host, SSH port, and account credentials.
  3. Verify the SFTP host key. Compare the first-connection fingerprint with the verified value from step 6 or the administrator. Accept only if it matches; otherwise cancel.
    WinSCP first-connection dialog showing the SSH host key fingerprint before accepting it.
    Compare WinSCP’s fingerprint with the value verified from Ubuntu before accepting.
  4. Transfer files. WinSCP shows local Windows files in one pane and Ubuntu files in the other. Browse to the folders, then drag files between panes or use the transfer controls. Ubuntu file permissions still apply.
    WinSCP two-pane file manager showing Windows files on the left and Ubuntu files on the right.
    Transfer files between the local Windows pane and the remote Ubuntu pane.

Fix common connection errors

  • Connection timed out: Check the address, network, VPN, and firewall rules.
  • Connection refused: Check that openssh-server is installed, ssh is running, and the port is correct.
  • Permission denied: Check the username, password, or required SSH key.
  • Host name not found: Try the Ubuntu LAN IP or ask for the correct DNS name.

For detailed configuration, see the Ubuntu OpenSSH server guide, Ubuntu’s UFW firewall guide, Microsoft’s Windows SSH documentation, WinSCP’s SFTP connection guide, and its host-key verification guidance.

Leave a Comment

How to Record Speaker Output on Linux with Audacity

How to Record Speaker Output on Linux with Audacity

Capture Linux desktop audio in Audacity by routing its recording stream to your output device’s monitor source. Follow PulseAudio and PipeWire steps, export tips, and fixes for silent tracks.

How to Use Dropbox on Linux: Install and Sync Your Files

How to Use Dropbox on Linux: Install and Sync Your Files

Install Dropbox on Linux from the official package, sign in, sync a local folder, manage selective sync, and check status from the command line.

How to Install Inkscape on Linux: Ubuntu, Fedora, Arch, and More

How to Install Inkscape on Linux: Ubuntu, Fedora, Arch, and More

Install Inkscape from your Linux distribution’s repositories, the Ubuntu stable PPA, Snap, or Flathub, with current commands and notes for choosing a package source.

How to Find and Remove Duplicate Files on Linux With FSlint

How to Find and Remove Duplicate Files on Linux With FSlint

Use FSlint to scan selected Linux folders, review duplicate groups, and safely delete redundant files or learn when hard-link merging is appropriate.

How to Install SABnzbd on Linux and Configure It

How to Install SABnzbd on Linux and Configure It

Install SABnzbd on Ubuntu or Debian, or run it in Docker on another Linux host. Then open the web interface and configure your provider and download folders.

How to Install the Paper GTK Theme on Linux

How to Install the Paper GTK Theme on Linux

Install the Paper GTK theme from supported Linux repositories, enable it for GTK apps in GNOME Tweaks, and see what the legacy theme can and cannot change.

How to Install and Set Up Plex on OpenMediaVault with Compose

How to Install and Set Up Plex on OpenMediaVault with Compose

The old OpenMediaVault Plex plugin is archived. Set up Plex on OMV 8 with OMV-Extras, the Compose plugin, persistent storage, and Plex’s official container.

How to Clean and Speed Up Ubuntu Safely

How to Clean and Speed Up Ubuntu Safely

Clean and speed up Ubuntu with safe APT cleanup, storage checks, and startup controls that help free space and troubleshoot a sluggish desktop.

How to Install the Hiri Email Client on Linux

How to Install the Hiri Email Client on Linux

Install Hiri on Linux with its Snap package or official tarball, add a desktop launcher, and check supported accounts plus a warning about Hiri’s old Snap release.

How to Get System Specifications for a Linux PC

How to Get System Specifications for a Linux PC

Use Fastfetch and built-in Linux commands to check your distro, kernel, CPU, memory, graphics, storage, and connected devices, then save a clear report.