Solved

Copy jailed data SFTP Centos from one Linux server to another.

Posted on 2016-11-18
5
22 Views
Last Modified: 2016-11-28
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.
0
Comment
Question by:Nitsan Reznik
  • 3
  • 2
5 Comments
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 41894128
If you have a file with user names and passwords(!) you could use expect and regular ftp, or you can use sftp if you prefer.
0
 

Author Comment

by:Nitsan Reznik
ID: 41894130
Hi,

Appreciate your response however, how can I use expect script in my example to achieve my goal?
0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 41894156
Expect is a Tcl extension. You have a list of accounts that you need to copy over. Processing that list is done in Tcl: expect does the mechanics of automating what would otherwise be a manual interactive command-line process.
I believe other scripting languages such as Perl have expect-like extensions to them. You may find this to be adequate if you have more expertise with one of these languages. Failing that, you may wish to conside hiring a consultant.
0
 

Accepted Solution

by:
Nitsan Reznik earned 0 total points
ID: 41899571
I ended up asking one of our DBAs and he has created for us a script using tar command.
0
 

Author Closing Comment

by:Nitsan Reznik
ID: 41903941
No one else could have helped me
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Virtualizing very old guest OS 4 79
Where do I learn ES6? 3 49
Recursively Delete Files 5 66
Centos 7 User to Start Apache, MariaDB, LDAP 5 26
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
The viewer will learn how to dynamically set the form action using jQuery.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now