Forum Discussion

mr_evil_116524's avatar
mr_evil_116524
Icon for Nimbostratus rankNimbostratus
Apr 29, 2014

Automated Backup Solution

Hello All, I am trying to set up following auto backup solution found here - https://devcentral.f5.com/wiki/iApp.Complete-F5-Automated-Backup-Solution.ashxDescription_1?NS=iApp

 

I have followed everything created the key as documented and I have tested from F5 CLI and I was able to SFTP and SCP without password (I selected the option backup on this f5).

 

However when I use the GUI and select the option SFTP or SCP it requires me to put in "Enter the SSH private key to be used for passwordless authentication" and "Set the remote directory the archive should be copied to"

 

So the question is for SSH private key do I get that from /root/.ssh/id_rsa ? and do I copy paste the entire key? Also for destination does it use "/" or "\".

 

Lastly where is log kept of this iAPP? I have looked almost everything couldnt find it?

 

Please help.

 

Thanks

 

12 Replies

  • I have found the logs, and what I can see in there as follows: Permission denied, please try again. Permission denied, please try again. Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
  • The key you are looking for should be /config/ssh/ssh_host_dsa_key

     

    • mr_evil_116524's avatar
      mr_evil_116524
      Icon for Nimbostratus rankNimbostratus
      Hi Cory, I know where to find the key but how do I copy paste the content of the file in txt box as there is no way for me tell whether entire is has been uploaded there or not. Thanks
    • Cory_50405's avatar
      Cory_50405
      Icon for Noctilucent rankNoctilucent
      You can print to screen the private key using cat. cat /config/ssh/ssh_host_dsa_key
    • mr_evil_116524's avatar
      mr_evil_116524
      Icon for Nimbostratus rankNimbostratus
      Hi Cory, I have done that before I am still getting the same error.... and shouldn't it be the RSA key .... ? Anyway I have used the RSA private key which didnt work ? Any other idea? Thanks
  • Marvin's avatar
    Marvin
    Icon for Cirrocumulus rankCirrocumulus

    I used ssh-keygen -t rsa to generate a new keypair and it is saved in /root/.ssh/id_rsa. You need to import id_rsa.pub in authorized_keys file of the receiving sftp server host in $HOME/.ssh. Make sure that you have the appropiate read rights on the receiving server to this file.

     

  • Marvin's avatar
    Marvin
    Icon for Cirrocumulus rankCirrocumulus

    Also I used the following scripts to automate backup using SFTP and the sent an email if the upload failes. The local created backup files are automatically on the Big IP to save disk space.

    !/bin/bash

    DATE=

    date "+%m_%d_%y"

    Here we create the ucs archive and append the date

    tmsh save sys ucs bigip.backup.$DATE

    upload SFTP to SFTP_server

    cd /var/local/ucs/ sftp backupuser@SFTP_server <

    check if the upload has succeeded or failed. If failed mail error message

    if [ $? -eq 0 ] then sleep 5 rm /var/local/ucs/bigip.backup.$DATE.ucs else ftp session failed mail -s "ftp backup file failed from BigIP" mail@mail.com < /dev/null fi

  • Marvin's avatar
    Marvin
    Icon for Cirrocumulus rankCirrocumulus

    description !/bin/bash DATE=

    date "+%m_%d_%y"

    description Here we create the ucs archive tmsh save sys ucs bigip.backup.$DATE

    description upload SFTP to SFTP_server cd /var/local/ucs/ sftp backupuser@SFTP_server <

    description check if the upload has succeeded or failed. If failed mail error message

    if [ $? -eq 0 ] then sleep 5 rm /var/local/ucs/bigip.backup.$DATE.ucs

    else ftp session failed

      mail  -s "ftp backup file failed from bigip" mail@mail.com 
      < /dev/null
    

    fi

  • Riley_Schuit_82's avatar
    Riley_Schuit_82
    Historic F5 Account

    Hi! I just want to share a simple backup solution. Try doing this (source: ">http://www.linuxproblem.org/art_9.html" target="_blank">">http://www.linuxproblem.org/art_9.html😞

    ssh-keygen -t rsa
    

    Then you can give my script a try: ">https://github.com/rileyschuit/bash-tools/blob/master/bigip_backups.sh" target="_blank">">https://github.com/rileyschuit/bash-tools/blob/master/bigip_backups.sh

    Adjust the array to point to your management addresses they use the argument "setup" to copy the public keys in the right place. Adjust the target directory as well, if needed.

    • Riley_Schuit_82's avatar
      Riley_Schuit_82
      Historic F5 Account
      Thank the devcentral WYSIWYG for making my post super ugly....
  • Check out GitHub for the latest version of the F5 Automated Backup iApp, and submit any bugs or questions as an "Issue" on GitHub:

     

    https://github.com/tabernarious/f5-automated-backup-iapp