The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WHM Remote backup issue

Discussion in 'General Discussion' started by efuzone, Mar 23, 2011.

  1. efuzone

    efuzone Active Member

    Joined:
    Mar 17, 2011
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hello I want to setup standard backup to my dedicated server and also want to backup remotely to my FTP server how is it possible? I have dedicated server with whm.
     
    #1 efuzone, Mar 23, 2011
    Last edited: Mar 23, 2011
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You cannot backup both on the machine and remote FTP on the machine using WHM > Backup > Configure Backup area. You would need to select one option, which would be easiest to select to backup on the server itself. After backing up on the server, then you could scp or rsync the backups to the remote server, which would be more secure anyway.

    If you setup SSH keys for the machines to talk to each other, you could add a cron to root crontab (crontab -e or /var/spool/cron/root) to scp or rsync the backup folders to the remote machine if that remote machine is running Linux or FreeBSD. If it isn't, you could cron it to ftp the backup instead.
     
  3. efuzone

    efuzone Active Member

    Joined:
    Mar 17, 2011
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hello,
    Can you help me please like what i set in cron to manage standard backup first and then it upload remotely backups to my ftp server please.
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Please indicate if your remote machine is Linux or FreeBSD or Windows so I know what to suggest.
     
  5. efuzone

    efuzone Active Member

    Joined:
    Mar 17, 2011
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Both servers are linux and one is dedicated second is vps, i want dedicated server backups standard and remotely to vps.
     
  6. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    So the remote VPS with Linux, you do have root SSH to it to scp or rsync files there, correct? If so, there is no reason to use FTP, which is not securely transferring. You would want to use scp (secure copy) or rsync (again this is secure). Please confirm if you have root SSH and then I will provide a cron command to rsync and a cron command to scp the backups. The command will assume you have added SSH keys to both machines to where they can talk to each other without needing password authentication.

    If both machines have cPanel, you can add SSH keys for each machine in WHM > Manage root’s SSH Keys area. If you are uncertain how to perform this function, please let us know.
     
  7. efuzone

    efuzone Active Member

    Joined:
    Mar 17, 2011
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Yes both are Cpanel/WHM and i have both roots..
     
  8. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You can try the following scp cron in crontab -e or by adding to /var/spool/cron/root file:

    Code:
    0 22 * * * /usr/bin/scp -pr /pathtolocalbackup root@IP#:/pathtoremotebackup
    This would scp the backup files at 10:00pm server time every day. Here the /pathtolocalbackup is the local server's full path to the backup files, IP# is the remote server's IP number, and /pathtoremotebackup is the full path to where you want to store the remote backup.

    I selected 10:00pm as the time to scp the files because cpbackup normally runs around 1 or 2am on many systems, this ensures that cpbackup has completed making the day's backups before scping the copy to the remote machine.

    You need to ensure to add the SSH keys from each machine to the other so they don't require a password to authenticate when running commands like scp.
     
  9. efuzone

    efuzone Active Member

    Joined:
    Mar 17, 2011
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    ok i will add cron now but tell me where i add ssh key, u mean to say i add ssh keys both servers each other like dedicated to vps and vps to dedicated?
    and then i just add this cron?
     
  10. efuzone

    efuzone Active Member

    Joined:
    Mar 17, 2011
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    i have created keys to both servers and also edited from command now tell me where to add ssh keys in whm? cron command i know where to add and is there is 00 22 it meanns 10 pm and if i add 00 04 or 00 4 it will generate on 4am right?
     
  11. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    As previously mentioned:

    You do add the VPS public SSH key to the dedicated, and the dedicated public SSH key to the VPS. You also need to ensure to authorize the keys in that area of WHM after adding them. To check they are working, try to SSH from one machine to the other as root. If you are able to do so without a password prompt occurring, then it is working.

    For your other question:

    0 4 * * * will be 4:00am server time, correct.
     
  12. efuzone

    efuzone Active Member

    Joined:
    Mar 17, 2011
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    thats the confusion when i go to manage ssh keys it is asking me to generate new key and import key.. i generated new keys in both servers with name and password but name is not root and password is also not root's password.. it given me key.. but dont know how to add there key of another server..
     
  13. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You import the key of the other server using the option to import.
     
  14. efuzone

    efuzone Active Member

    Joined:
    Mar 17, 2011
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hello Bro,
    I have added both keys in each other and also authorize them and also setup cron in dedicated server..
    now i want to know how to verify keys are working means both servers are communicating?
     
  15. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello efuzone,

    As I mentioned above:

    You need to do this from both machines, so check the dedicated to VPS SSH works without a password, then check the VPS to dedicated works without a password when SSHing from one to the other.

    Thanks.
     
  16. efuzone

    efuzone Active Member

    Joined:
    Mar 17, 2011
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    When i am trying from dedicated to VPS
    it is saying
    The authenticity of host 'xxxxx.xxxxxxx.com (173.xxx.xxx.xxx)' can't be established.
    RSA key fingerprint is 31:ec:1b:8e:35:xx:xx:xx:Xx:xx:xx:xx:xx:xx:xx:3b.
    Are you sure you want to continue connecting (yes/no)? yes
    when i press yes it is asking for password..

    when i am trying from vps to dedicated it is saying
    ssh: connect to host xxx.exxxxx.com port 22: Connection refused
    it is because i have ssh port change in dedicated server
     
  17. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    The dedicated to VPS matters more as that's the cron path (dedicated to VPS). When you generated the keys, you had it use a challenge password? If so, regenerate them without one. The point here was to not require any password.
     
  18. efuzone

    efuzone Active Member

    Joined:
    Mar 17, 2011
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    hmm in start i went to manage ssh keys then generate a new key, then i just added there name like efuzone1 and password i added not really vps password i added there one other pass difficult one.. then selected DSA and submit.. it given me finger prints and keys i got from root/.ssh dir.... i did same with vps.. just changed name efuzone2
     
  19. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You should not add a password at all when generating the key. It then makes it a challenge password which is required when trying to use the key.
     
  20. efuzone

    efuzone Active Member

    Joined:
    Mar 17, 2011
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    if i leave password field it says risk!

    Using public key authentication without specifying a pass phrase is a huge security risk!
    Please reconsider using a pass phrase, delete the generated key, and create a new one using a strong pass phrase.
    Continuing ...
    Enter passphrase (empty for no passphrase): Enter same passphrase again: Generating public/private dsa key pair.
     
Loading...

Share This Page