Teach you to use the SCP to perform a scheduled backup between Linux hosts

Source: Internet
Author: User
Tags ssh scp command ssh server backup linux

On both Linux hosts and SSH privileges, it is recommended that you use the SCP command backup, which is fast and encrypted and has high security. But large data files, do not recommend the use of this method to back up!

OK, the experiment is simple:

1 SSH transmission requires the key we need to create the key to verify!

SSH Server side:

[Root@text ~]# ssh-keygen-t RSA

Generating public/private RSA key pair.

Enter file in which to save the key (/ROOT/.SSH/ID_RSA): Enter

Enter passphrase (empty for no passphrase): Enter key

Enter Same Passphrase Again:enter key

Your identification has been saved In/root/.ssh/id_rsa.

Your public key has been saved in/root/.ssh/id_rsa.pub.

The key fingerprint is:

Xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx root@text.org

[Root@text ~]# CD. ssh/

[Root@text. ssh]# ls

Id_rsa id_rsa.pub known_hosts

[Root@text. ssh]# SCP id_rsa.pub Root@192.168.0.160:/root/.ssh/authorized_keys

Enter password key transmission for target host passed

Then the next transfer file will not be prompted to enter the password!

This is a good start for our crontab to write a scheduled task backup.

Author Signature: 51cto blog Baby garden Children's shoes

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/

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.