ssh自动登录

ssh自动登录

ssh-keygen -t rsa
ls /root/.ssh
scp /root/.ssh/id_rsa.pub serverB:/root/.ssh/authorized_keys
#!/bin/sh
#先执行如下过程进行自动登录设置
#
#ssh-keygen -t rsa
#ls /root/.ssh
#
#scp /root/.ssh/id_rsa.pub serverB:/root/.ssh/authorized_keys
#执行任务定制
#crontab-e
#增加
#*/1 * * * * sh /opt/jh_sync.sh
#
#
rsync -vzrtopg --rsh=ssh [email protected]:/usr/bj_app/news/$(date +%Y%m%d) /opt/abc
#
rsync -vzrtopg --rsh=ssh [email protected]:/usr/bj_app/news/$(date +%Y%m%d) /opt/news
rsync -vzrtopg --rsh=ssh [email protected]:/usr/bj_app/blockpics/$(date +%Y.%m.%d) /opt/blockpics
#
 

你可能感兴趣的:(ssh,职场,自动登录,休闲)