Copy jailed data SSH Centos from one Linux server to another

Hello to all the experts around here.

I need to be able to create a script which will be copying all the data from each user account's jail home folder (SFTPWRITE) on one Centos 7 server to antother Centos 7 server. Both of the Centos servers are using Chroot jail where each account logs in to his home folder (/home/user/SFTPWRITE) and cannot see any other users folders.

For example: the home folders for each account is /home/temp01/SFTPWRITE where temp01 is the user and the home folder and the SFTPWRITE is the area from which each account has a write permissions.

I have got the same users and passwords + chroot jail permissions set up on both servers but the only thing I need is to copy the SFTPWRITE data for each account to a different server. If that helps, I also have a txt file which includes username and password.

Any help will be highly appreciated.

Welcome nreznik,

I have a few to questions pose in response first:-

  • Is this homework/assignment? There are specific forums for these.
  • What have you tried so far?
  • What output/errors do you get?
  • What OS and version are you using?
  • What are your preferred tools? (ftp, sftp, scp, rsync etc.)
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)

Most importantly, What have you tried so far?

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.

We're all here to learn and getting the relevant information will help us all.

Kind regards,
Robin

Being in a chroot jail means they have no access to other commands, like archival commands. So, login as some other user, to create the archive with tar -zcpf filename.tar /path/to/chroot/jail , copy it over with scp, then extract it on the other side with tar -zxpf filename.tar