anhnongdan / bimax_ha_migration

all db backup, recovery and migration scenarios for bimax
0 stars 0 forks source link

VNPT can't run rsync to upload DB backup #8

Closed anhnongdan closed 7 years ago

anhnongdan commented 7 years ago

When run with sh manually, everything work fine. When run with cron, it seems that files can't be upload.

anhnongdan commented 7 years ago

It seems that it's only problem with Key and Permission. No more

=> added rsync -avzh -e 'ssh -i /root/.ssh/id_rsa.pub' but no luck

anhnongdan commented 7 years ago

Result:

[root@VNPT-HNI-ANALYTIC-02 bimax_ha_migration]# tailf /tmp/rsync.log 
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/root/.ssh/id_rsa.pub' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /root/.ssh/id_rsa.pub
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(605) [sender=3.0.9]
  1. Tried ssh -i /id_rsa.pub but no success. key permission needs to be 600

    [root@VNPT-HNI-ANALYTIC-02 bimax_ha_migration]# ll ../.ssh/
    total 16
    -rw-r--r--  1 root root 2562 Jul 25 10:58 authorized_keys
    -rw-------. 1 root root 3243 Feb  8 18:11 id_rsa
    -rw-------. 1 root root  751 Feb  8 18:11 id_rsa.pub
    -rw-r--r--. 1 root root 1099 Aug  4 12:04 known_hosts
  2. It works with ssh -p 22 as above.

anhnongdan commented 7 years ago

cef13c323b4fdd23f134a4bab26a010f7d430f4f