•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Backup
    • Content Delivery Network
    • Colocation Hosting
    • Dedicated Hosting
    • DDoS Mitigation
    • IP Transit
    • Private Cloud
    • Wavelength
  •  Solutions
    • Ecommerce
    • Finance
    • Gaming
    • Hosting
    • Management
    • Security
    • System Integrator
  •  Support
    • Community
    • Knowledge Base
    • Open A Ticket
  •  USA & Canada: 800-933-1517
  •  International: 626-549-2801
  •  Email: sales@psychz.net
  • Services
    • Dedicated Servers
    • Colocation
    • Private Cloud
    • DDos Protection
    • IP Transit
    • CDN
    • Backup
  • Solutions
    • Ecommerce
    • Security
    • Gaming
    • Hosting
    • Management
    • Finance
    • System Integrator
  • Dashboard

SCP From Local Machine To Remote

  • Home
  • Client
  • Qa Forum
  • SCP From Local Machine To Remote

Posted By: Evan | 1 Replies | Last Reply On: Nov 05, 2019 12:36:17

Can someone provide a guide on how to SCP from local machine to remote? 

Psychz - Purnima

Votes: 0Posted On: Nov 05, 2019 12:36:17
 

SCP stands for a secure copy(cp), which means you can copy files across SSH connection between computers. Since SCP uses SSH protocol, tt is a very secure way to copy files between computers as SSH (Secure Shell) is a cryptographic network protocol for operating network services securely over an unsecured network. It is included by default in most Linux and Unix distributions. By default, SCP uses the port 22, and connect via an encrypted connection or secure shell connection. You can also copy files directly from one remote server to another remote server using SCP.  SCP is very versatile and can be used on Linux, Mac, and Windows (using WinSCP).

 We are going to start with some basic commands and examples here.

The following syntax is used to copy a file from the source to a destination.

# scp source_file_path destination_file_path

Depending on the type of host, the above syntax will also need a file path with full host address, port number, username and password along with the directory path.

So if you want to send file from your local machine to a remote machine the syntax would look like this

# scp /local_machine_file.txt user@172.212.xxx.xxx:/some/remote/directory

This will be reverse when copying file from remote host to local host.

# scp user@172.212.xxx.xxx:/some/remote/directory /local_machine_file.txt

just download the file

# scp user@172.212.xxx.xxx:/some/path/file.txt

NOTE: By default scp will always overwrite files on the destination.

The following syntax will guide you to copy the same file from user1 home folder to user2 home folder in another remote machine.

# scp user1@152.144.xxx.xxx:/home/file.txt user2@172.168.xxx.xxx:/home/

Now, with the following syntax we will see how to Copy one single file from a remote host to the same remote host in another location

# scp user1@152.144.xxx.xxx:/home/file.txt user2@152.144.xxx.xxx:/home/

 

Now we will see how to Copy the directory "demo_dir" from the local host to a remote host's directory "location"

# scp -r demo_dir user1@152.144.xxx.xxx:/remote/directory/location

We will see now how to copy multiple files using scp command. You can copy multiple files at once without having to copy all the files in a folder, or copy multiple files from different folders putting them in a space separated list.

# scp file1.txt file2.txt file3.txt user1@172.165.xxx.xxx:/home/user1/

If you want to copy multiple files that are located in different folders you need to specify the complete path.

# scp /path/to/file1.txt /path/to/file2.txt /path/to/file3.txt user1@172.165.xxx.xxx:/home/user1/

 

The following syntax will copy all files of a given extension to the remote server. For instance, you want to copy all your text files (txt extension) to a new folder. Here we will use a wildcard asterisk (*) to simplify the task. 

# scp /home/user/*.txt user1@172.165.xxx.xxx:/home/user1/

 

Copy all files in a folder with any extension to a remote server. This will copy all files inside local folder to the remote folder. Here's an example.

# scp /home/user/html/* jane@host.example.com:/home/jane/backup/

 

Other available GUI based tools available for using SCP

WinSCP

If you are working on a Windows powered computer, you can still enjoy scp in various ways. Winscp is a powerful GUI tool available used by a large number of user base that use windows platform.

pscp

pscp is a shell command that works almost on Windows Shell the same way that scp works on Linux or Mac OS X

Was this reply helpful?

Related topics

  • SCP Command Syntax Examples in Linux
  • SCP From Remote To Local
  • How to transfer/copy files between local and server using a remote desktop connection?
  • How to change the password through Remote Desktop (RDP)
  • Best Hardware For Machine Learning
  • Rent Remote Desktop Computer
  • How much for remote hands?
  • How To Remotely Connect To Windows Server?
  • How to rsync two directories
  • Guide to establish a GRE Tunnel and BGP peering session on MikroTik RouterOS
  • Cloud Hosting vs. Dedicated Server - How Do You Choose?
  • Why Gaming Companies are Choosing Bare Metal Servers
  • Global Server Load Balancing
  • DDoS Extortion: The Latest Nefarious Twist on Cyber Crime
  • Linux Systems Are In Serious Need Of A Ghostbuster
Hosting Services
  • Dedicated Hosting
  • Colocation Hosting
  • Backup
  • IP Transit
  • DDoS Mitigation
Support
  • Portal Login
  • Knowledgebase
  • Community
Company
  • About Us
  • Contact Us
  • Network
  • Data Centers
  • Looking Glass
  • Affiliates
  • Reseller
  • Blog
Policies
  • Privacy Policy
  • Acceptable Usage Policy
  • Terms and Conditions
  • Service Level Agreement
Company
  • Psychz Networks,
    A Profuse Solutions Company
    611 Wilshire Blvd #300
    Los Angeles,California 90017
    USA
  • US/Canada: 800-933-1517
  • International: 626-549-2801
Subscribe to Our Mailing List
* indicates required
Copyright © 2023 Psychz Networks, A Profuse Solutions Inc Company