使用scp在Linux主机之间进行定时备份
2012-03-06 09:33
288 查看
在两台Linux主机,而且都是ssh权限,那就建议使用scp命令备份了,这种备份速度快且是加密传输,安全性高。但是大数据的文件,不建议使用这中方法去备份!
好的,实验很简单:
1 ssh传输需要密钥的 我们需要创造密钥用来验证!
ssh服务器端:
[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键
Enter same passphrase again: enter键
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
输入目标主机的密码 密钥传输过去了
那么下次传输文件 就不会在需要提示输入密码的!
这就为了我们crontab的写计划任务备份做了好的开头了
本文出自 “幼兒園童鞋” 博客,请务必保留此出处http://yangxiaofei.blog.51cto.com/2910082/797764
好的,实验很简单:
1 ssh传输需要密钥的 我们需要创造密钥用来验证!
ssh服务器端:
[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键
Enter same passphrase again: enter键
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
输入目标主机的密码 密钥传输过去了
那么下次传输文件 就不会在需要提示输入密码的!
这就为了我们crontab的写计划任务备份做了好的开头了
本文出自 “幼兒園童鞋” 博客,请务必保留此出处http://yangxiaofei.blog.51cto.com/2910082/797764
相关文章推荐
- 使用scp在Linux主机之间进行定时备份
- 使用tshark抓包以及使用scp在Linux主机之间进行定时备份
- 在Linux主机之间进行定时备份
- 使用scp在linux主机之间传输文件
- Linux下使用crontab对MYSQL进行备份以及定时清
- 当两台LINUX主机之间要互传文件时可使用SCP命令来实现
- 当两台LINUX主机之间要互传文件时可使用SCP命令来实现
- Linux主机scp命令详解和定时备份方法
- 使用scp在linux主机之间无密码复制文件/目录
- 使用vmware实现Window主机与Linux之间进行文件共享
- 使用scp在Linux之间进行文件传输
- 使用scp在linux主机之间复制文件目录
- Linux中使用mysqldump对MySQL数据库进行定时备份
- 使用scp在linux主机之间传输文件
- Centos使用scp在Linux系统之间进行文件传输
- 当两台LINUX主机之间要互传文件时可使用SCP命令来实现
- 当两台LINUX主机之间要互传文件时可使用SCP命令来实现
- 使用Linux的crontab调用shell中的scp自动备份mysql数据
- Linux下定时自动备份远程主机mysql数据库并拷贝到其他主机
- Linux下使用crontab调用shell中的scp自动备份mysql数据