Transfer data directly between two Ubuntu with a command

Source: Internet
Author: User
Tags rsync scp command

First check to see if Openssh-server is started:

PS grep SSH

If there is no prompt then it is not started:

sudo/etc/init.d/ssh

Start the process. If you are prompted to find a command, you need to install Openssh-server:

sudo Install Openssh-server

In addition, openssh-client Ubuntu is already installed by default and can be installed with the following command if not installed:

sudo Install openssh-client

You can then transfer the file using the Scp/rsync command.

SSH [email protected] ' s IP (eg.  192.168. 0.1
#SSH Remote login Ubuntu Machine

SCP -R [email protected]192.168. 0.1:/home/username/
# Copy files/folders from the remote Ubuntu machine to local (SCP)

SCP -R localfile.txt [email protected]192.168. 0.1:/home/username/
#


# copy files / folders from the remote Ubuntu machine to local (rsync)

-v-u-a–delete–rsh=ssh –stats localfile.txt [email protected]192.168. 0.1:/home/username/  
#

The SCP command can be used to transfer files between machines through secure, encrypted connections. It is similar to RCP.

The general syntax for transferring local files to a remote system is:

SCP localfile [email protected]:/
LocalFile Specify the source file, [email protected]:/newfilename Specify the destination file.

To transfer the local file Shadowman to your account on Penguin.example.net, type (replace the username with your username) at the shell prompt:

Scp

This will transfer the local file Shadowman to the/home/username/shadowman file on Penguin.example.net. The general syntax for transferring remote files to the local system is:

SCP [Email protected]:/remotefile/

The source file can consist of multiple files. For example, to transfer the contents of the directory/downloads to the existing uploads directory on the remote machine penguin.example.net, type the following command at the shell prompt:

SCP /downloads/*  [email protected]:/uploads/

Reference:

http://blog.163.com/wz_pk007/blog/static/170627050201251431325833/

http://asyty.iteye.com/blog/1440141

Transfer data directly between two Ubuntu with a command

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.