Linux下使用crontab调用shell中的scp自动备份mysql数据
一、为了在Linux下使用scp的时候不需要输入密码,采用ssh另一种用密钥对来验证的方式 。
1、使用ssh-keygen 命令生成密钥。生成过程中,除了输入密码外,其他都选择默认的值:回车即可。
[root@xxx root]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
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:
e0:f0:3b:d3:0a:3d:da:42:01:6a:61:2f:6c:a0:c6:e7 root@xxx
[root@xxx root]#
相关推荐
tianhuak 2020-11-24
以梦为马不负韶华 2020-10-20
彼岸随笔 2020-10-20
yutou0 2020-10-17
applecarelte 2020-10-16
ourtimes 2020-10-16
codedecode 2020-11-14
farwang 2020-11-25
星愿心愿 2020-11-24
zhjn0 2020-11-24
昭君出塞 2020-11-23
bluecarrot 2020-11-23
linuxwcj 2020-10-21
waterhorse 2020-09-19
MRFENGG 2020-11-11
rainandtear 2020-10-30
kyssfanhui 2020-10-20