|Blogs|Transfer Easy Files with Native OpenSSH on Windows, Linux, and Mac: A Complete Guide
ringring
DevOps
Transfer Easy Files with Native OpenSSH on Windows, Linux, and Mac: A Complete Guide
Published by:Anuj Poudel
Published on:18 Jun, 2024
blogimage
Share

Revolutionize Your File Transfers with Native OpenSSH on Windows, Linux, and Mac

Transferring files between your local machine and a remote server can often feel like a cumbersome process. Typically, this task relies on third-party software, each with its quirks and platform dependencies. Tools like FileZilla or WinSCP are widely used but come with their own set of challenges:

  • Platform Limitations: While FileZilla is cross-platform, WinSCP is Windows-specific, limiting its use across different operating systems.
  • Complex Configuration: Initial setup and configuration can be tedious, especially for users new to these tools.
  • Security Concerns: FTP clients, unless explicitly set up with secure protocols like SFTP, can pose security risks.

FileZilla interface – great, but can be a hassle to set up and use.

Why SFTP Is Your Go-To Solution

SFTP (SSH File Transfer Protocol) is a reliable and secure method for transferring files between your local machine and a VPS (Virtual Private Server). Using SSH (Secure Shell), SFTP encrypts your data, ensuring a safe transfer process. It’s typically more secure and streamlined than traditional FTP methods, often requiring third-party applications like PuTTY or MobaXterm.

SFTP utilizes SSH for secure, encrypted connections.

Native OpenSSH in Windows 10 and Later

With Windows 10 (version 1809 and later), Microsoft introduced native OpenSSH support, simplifying the use of SFTP without needing extra software. This addition means you can use SFTP directly from your command line, reducing the need for third-party tools.

Installing OpenSSH on Windows 10

Here’s how to enable and use OpenSSH on Windows 10:

  1. Open Settings:

    • Press Win + I to launch the Settings app.
  2. Navigate to Optional Features:

    • Go to Apps → Optional features.
  3. Install OpenSSH Client:

    • Scroll down to find OpenSSH Client. If it isn’t listed, click Add a feature.
    • Search for OpenSSH Client and click Install.

Using SFTP on Windows 10

Once OpenSSH is installed, you can start using SFTP to manage your file transfers. Here’s a step-by-step guide:

Step 1: Open Your Command Line Interface

  • PowerShell: Right-click the Start button and select Windows Terminal or PowerShell.

Step 2: Establish an SFTP Connection

Use the following command, replacing xxx.xxx.xxx.xxx with your remote server's IP address:

sftp user@xxx.xxx.xxx.xxx

You'll be prompted to enter your password. After successful authentication, the prompt changes to:

Connected to xxx.xxx.xxx.xxx.
sftp>
 
Step 3: Navigating and Transferring Files

You can now interact with the remote server. Here are some essential commands:

  • Remote Machine:

    • cd /path/to/directory: Change directory.
    • ls: List files.
    • pwd: Print current directory.
  • Local Machine:

    • lcd C:\path\to\directory: Change the local directory.
    • lls: List local files.
    • lpwd: Print local directory.

Example Commands

  1. Uploading a File

To upload a file from your local machine to the remote server:
put C:\local\path\file.txt /remote/path/file.txt 

Example:
put C:\Users\YourName\Documents\secret.json /project1/secret.json

  1. Downloading a file

To download a file from the remote server to your local machine:
get /remote/path/backup.sql C:\local\path\backup.sql

Example:
get /project1/backup.sql C:\Users\YourName\Downloads\backup.sql

Using SFTP on Linux & Mac

Linux and Mac systems typically come with OpenSSH pre-installed, making SFTP a straightforward option for secure file transfers.

Step 1: Open Terminal

Launch your terminal application.

Step 2: Establish an SFTP Connection

Use the following command, replacing xxx.xxx.xxx.xxx with your remote server's IP address:

sftp user@xxx.xxx.xxx.xxx

You'll be prompted to enter your password. After successful authentication, the prompt changes to:

Connected to xxx.xxx.xxx.xxx.
sftp>

Step 3: Navigating and Transferring Files

Once connected, you can use similar commands as mentioned above (cd, ls, pwd, lcd, lls, lpwd):

Example Commands

  1. Uploading a File

put /home/username/secret.json /remote/path/secret.json

  1. Downloading a File

get /remote/path/backup.sql /home/username/backup.sql

Conclusion

Whether you’re on Windows, Linux, or macOS, SFTP combined with OpenSSH provides a powerful and secure method for file transfers, minimizing reliance on third-party software. This approach ensures a consistent and straightforward experience across all major operating systems.

Quick Commands Summary

Action Command
Connect sftp user@xxx.xxx.xxx.xxx
Upload File put /local/path/file /remote/path/file
Download File get /remote/path/file /local/path/file
Change Dir cd /remote/path or lcd /local/path
List Files ls or lls
Print Dir pwd or lpwd

For more detailed instructions or troubleshooting tips, feel free to reach out at anuj@dallotech.com


Additional Resources:


Happy transferring! 🚀

Other related blogs
Technology
Integrating Online Payment in NestJS using Factory Pattern: Khalti Payment (Part 3)

If you are integrating Khalti payment provider in NestJS or interested in knowing how Khalti payment API handles transaction, this blog is perfect for you.

Technology
Integrating Online Payment in NestJS using Factory Pattern: eSewa Payment (Part 2)

If you are integrating eSewa payment provider in NestJS or are interested in knowing how eSewa payment API handles transaction, this blog is perfect for you.

Technology
Integrating Online Payment in NestJS using Factory Pattern: Project Setup, Service Layer and APIs (Part 1)

If you are integrating a payment features(eSewa, Khalti, ConnectIPS, Stripe, PayPal etc.) in NestJS or are interested in knowing how online payment features can be implemented, this blog is perfect for you.

Technology
Restore MSSQL Database file .bak on a Linux Server

If you need to restore a MSSQL database file (.bak) on a Linux server, this is the perfect blog for you. Additionally, anyone interested in web development, database management, or technology in general may also find this useful and interesting.

Discover Dallo Tech, a leading software development company offering expertise in Mobile and Web App Development, Data Analytics, Visualization, AI, and Blockchain solutions. Elevate your digital journey with our innovative technology services.

Open Hours

Sun - Fri:
10:00 am - 5:00 pm

Saturday:
CLOSED

Dallotech as tech partner
Business Team
Devops and Service
Design Team
Quality Assurance
Software Team
Mobile Team
Hire Expert Team
© 2018 - 2025 . DalloTech Pvt. Ltd. All Rights Reserved