Results 1 to 9 of 9

Thread: Backuping files via SFTP

  1. #1
    Join Date
    Dec 2005
    Beans
    54
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Question Backuping files via SFTP

    I'm trying to setup a system to backup my documents&images from Ubuntu to remote Ubuntu Server. I have tried to think how i would do it, but it seems to be bit complicated. This is what i'm trying to do:
    1. Program checks what files are new and packs them to zip file (also putting password for the zip file)
    2. Program transfers the newest zip files to remote location
    3. Program removes the zip file(s) from the source


    So the main problem is that i want files to be encrypted in the Ubuntu server so that no one can read them without the password. There are about 50Gb of files to backup and about 10mb of new files every week.

    Any suggestions how to do this?
    When you dream there are no rules. People can fly. Anything can happen. Sometimes there's a moment as you're waking and you become aware of the real world around you, but you are still dreaming. You may think you can fly but you better not try.

  2. #2
    Join Date
    Sep 2006
    Beans
    2,914

    Re: Backuping files via SFTP

    Quote Originally Posted by gizm0 View Post
    I'm trying to setup a system to backup my documents&images from Ubuntu to remote Ubuntu Server. I have tried to think how i would do it, but it seems to be bit complicated. This is what i'm trying to do:
    1. Program checks what files are new and packs them to zip file (also putting password for the zip file)
    1. check the man page of tar and zip. zip can let you include a password
    2. Program transfers the newest zip files to remote location
    sftp, ftp
  3. Program removes the zip file(s) from the source
you just need the rm command
Python tutorial |Unix power tools|Effective AWK|A handful of Awk|Perl|File Renamer|Bash ref
Advanced reply Adv Reply  

  • #3
    Join Date
    Oct 2005
    Location
    Al Ain
    Beans
    7,899

    Re: Backuping files via SFTP

    Hmm, Rsync over SSH is generally the best way to do it. Some Googling and man page reading will get you going. It is not difficult.

    Cheers,

    Herman

  • #4
    Join Date
    May 2007
    Beans
    7,032
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Backuping files via SFTP

    Quote Originally Posted by HermanAB View Post
    Hmm, Rsync over SSH is generally the best way to do it. Some Googling and man page reading will get you going. It is not difficult.

    Cheers,

    Herman
    +1 that's the best way handle the file transfer.

    For protecting your files from prying eyes, Zip is not the best way to go. The password protection is very weak and won't stop anyone. Plus, it would unnecessarily complicated to automate this along with rsync.

    I would suggest, instead, an encrypted partition -- this can be either a real partition/disk drive or a loopback device acting as a container for the encrypted filesystem. It's relatively simple to set this up to mount this encrypted filesystem when you're running the file transfer and then unmounting it (and thereby effectively closing it from everyone who doesn't own a quantum supercomputer) when it's not in use.
    I am aware of all internet traditions. | Getting the best help | Text formatting codes | My last.fm profile
    Should I PM support questions? NO!

  • #5
    Join Date
    Dec 2005
    Beans
    54
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Backuping files via SFTP

    Quote Originally Posted by p_quarles View Post
    +1 that's the best way handle the file transfer.

    For protecting your files from prying eyes, Zip is not the best way to go. The password protection is very weak and won't stop anyone. Plus, it would unnecessarily complicated to automate this along with rsync.

    I would suggest, instead, an encrypted partition -- this can be either a real partition/disk drive or a loopback device acting as a container for the encrypted filesystem. It's relatively simple to set this up to mount this encrypted filesystem when you're running the file transfer and then unmounting it (and thereby effectively closing it from everyone who doesn't own a quantum supercomputer) when it's not in use.
    How do i automate the mounting and unmounting of the truecrypt partition? As far as i know i think i need to manually enter the password for the partition.
    When you dream there are no rules. People can fly. Anything can happen. Sometimes there's a moment as you're waking and you become aware of the real world around you, but you are still dreaming. You may think you can fly but you better not try.

  • #6
    Join Date
    Mar 2007
    Location
    Denver, CO
    Beans
    7,554
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Backuping files via SFTP

    I prefer unison for two way synchronization -- rsync for one way transfers.

  • #7
    Join Date
    Dec 2005
    Beans
    54
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Backuping files via SFTP

    Quote Originally Posted by kevdog View Post
    I prefer unison for two way synchronization -- rsync for one way transfers.
    In this case i will use rsync. So any suggestions for automating truecrypt?
    When you dream there are no rules. People can fly. Anything can happen. Sometimes there's a moment as you're waking and you become aware of the real world around you, but you are still dreaming. You may think you can fly but you better not try.

  • #8
    Join Date
    Dec 2005
    Beans
    54
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Question Re: Backuping files via SFTP

    I figured out last night one way to do this:
    1. Source workstation connects to remote server via SFTP using public key
    2. Workstation uploads Truecrypt key to remote server
    3. Workstation sends command to mount truecrypt partition using the uploaded key
    4. Rsync connect to the remote server and starts uploading new files to the remote server
    5. Workstation sends command to umount truecrypt partition in remote server
    6. And at the last stage workstation sends command to remove the truecrypt key from the remote server and disconnects the connection


    Does this sound secure enough or am i making it too complicated?
    When you dream there are no rules. People can fly. Anything can happen. Sometimes there's a moment as you're waking and you become aware of the real world around you, but you are still dreaming. You may think you can fly but you better not try.

  • #9
    Join Date
    Dec 2005
    Beans
    54
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Backuping files via SFTP

    I'm now trying to create truecrypt keyfile, but i can't find option to create it. I have searched guides and found that i need to use command: truecrypt --keyfile-create /media/disk/mynewkey4

    This command does not work and i get error:
    Unknown long option 'keyfile-create'
    Error: Incorrect command line specified.

    So have they removed that option from truecrypt 6.0a?

    *SOLVED* I created the keyfile with "openssl genrsa -des3 -out mykey 1024".

    *EDIT* I still have one problem with Truecrypt mounting. It asks system administrator's password from time to time. How do i mount my partition without Truecrypt asking the system administrator's password?

    *SOLVED* I have created user group for the users using truecrypt and that's how i got it working. (http://www.howtoforge.com/truecrypt-...ubuntu-7.10-p2)
    Last edited by gizm0; July 16th, 2008 at 08:48 AM.
    When you dream there are no rules. People can fly. Anything can happen. Sometimes there's a moment as you're waking and you become aware of the real world around you, but you are still dreaming. You may think you can fly but you better not try.

  • Bookmarks

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •