标签:cti empty div check for main code host alt
一、安装cwrsync
二、创建密钥对,实现ssh免密码验证
linux服务器上
[root@zabbix ~]# ssh-keygen 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: ####回车 fc:68:38:67:fd:d4:7f:3b:e7:67:93:ed:e2:c0:a9:25 root@zabbix.suffergtf.com The key‘s randomart image is: +--[ RSA 2048]----+ | | | | | | | . | | S | | . + . o | | o = E * . o| | = * ..=*| | . ...*@| +-----------------+
[root@zabbix ~]# ssh-copy-id root@localhost
The authenticity of host ‘localhost (::1)‘ can‘t be established.
ECDSA key fingerprint is e5:07:2a:f0:9f:c5:df:64:70:61:6a:7a:31:bf:21:7a.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@localhost‘s password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh ‘root@localhost‘"
and check to make sure that only the key(s) you wanted were added.
[root@zabbix ~]# ls .ssh/
authorized_keys id_rsa id_rsa.pub known_hosts
###########将id_rsa下载到本地
三、编辑远程copy脚本
SETLOCAL SET CWRSYNCHOME=D:\cwRsync ####cwrsync安装路径 SET HOME=D:\cwRsync ######服务器密钥rd_rsa路径,我的路径为D:\cwRsync\.ssh SET CWOLDPATH=%PATH% SET PATH=%CWRSYNCHOME%\BIN;%PATH%
cd D:\cwRsync\bin
rsync -avz --delete /cygdrive/d/test root@192.168.127.250:/tmp ######/cygdrive是路径格式,我的实际路径为d:/test。
#########首次运行脚本需要手动输入一次密码########
四、定时运行
windows文件备份到linux:windows定时任务+cwrsync+ssh免密码认证
标签:cti empty div check for main code host alt
原文地址:https://www.cnblogs.com/suffergtf/p/9167400.html