Operating System - HP-UX
1748202 Members
2985 Online
108759 Solutions
New Discussion юеВ

encryypting files and automating file transfer to remote server

 
SOLVED
Go to solution
Mhanby
Regular Advisor

encryypting files and automating file transfer to remote server

My issue is similar to the following post: http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1432065, but we are not going to zip the file.

I need to encrypt (using GPG) and then send certain files to another organization's remote sftp server on a weekly and monthly basis. We are using ssh and originally were going to sftp the files. (Their remote server is a 3rd party Windows based ftp server.)

(For each transfer, the files will retain their original file names, so I also probably should archive the exisiting ones on the remote server prior to the copy, so that there is still an archived/backup copy of the existing files prior to sending the new file and overwriting the prior one/existing copy.)

I was hoping that somebody might already have have a similar script already written that I can use as an example and edit, as I was tasked to write a script to do this but I my scripting abilities are still very weak and in need/in the process of developing. :(

Therefore, any assistance would be greatly appreciated!!!

[THANKS in advance! :)]

ps- While searching the forums, I noticed mention of scp and rsync. Would either of these alternatives work or be a better method?


ps2- We also are not zipping the file prior to transfer. We cannot buy 3rd party software to do this.
13 REPLIES 13
Steven E. Protter
Exalted Contributor

Re: encryypting files and automating file transfer to remote server

Shalom,

scp encrypts the authentication and the data stream. There really is no NEED to further encrypt the file.

rsync has the -e ssh option which uses openssh(where scp comes from) to encrypt the data stream and the authentication, essentially achieving the same results.

gzip is open source and can be used to zip the file, no cost. If you want. It is very cpu intensive though.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Mhanby
Regular Advisor

Re: encryypting files and automating file transfer to remote server

Thanks, that is sort of what I got out of other replies while searching for an example, but I was hoping for were more detailed examples of how I could automate the process of getting any updated files located at a staging location on my server and transferring them to the remote location. I need to use ssh and they need to be encrypted prior to transferring them (and I was instructed to use GPG)...I was hoping somebody would already be doing something like this and might share or point me to where I could locate a sample shell script that I could use as a template to enlighten me on how this process could be automated using a shell script.

Thanks again!
Steven Schweda
Honored Contributor

Re: encryypting files and automating file transfer to remote server

I'm sure glad that I wasted my time posting
an answer to the now-deleted similar thread.
Mhanby
Regular Advisor

Re: encryypting files and automating file transfer to remote server

Steven S,

Sorry! I did not realize that you could not ask a question in just one of the forums. I posted to the general forum first (as that was where the similar thread was noted) but then I found the scripting forum and also posted to to there as well. Now I'll know not to post in more than one forum in the future.
James R. Ferguson
Acclaimed Contributor

Re: encryypting files and automating file transfer to remote server

Hi:

> Sorry! I did not realize that you could not ask a question in just one of the forums.

Most of the trollers here look at the HP-UX family as a whole, since it is known that the moderators will move threads around in the various sub-categories to better fit the nature of the question. Post once where you feel that it is most appropriate.

Regards!

...JRF...
Mhanby
Regular Advisor

Re: encryypting files and automating file transfer to remote server

Steven P.,

Regarding rsync, can this be used if the remote server is a Windows based server running a software to make it an sftp server?
I am using a Unix HP server but the remote server that we are sending the encrypted files to is not a unix server.

Maria
Mhanby
Regular Advisor

Re: encryypting files and automating file transfer to remote server

Also, the file needs to remain encrypted upon delivery on the remote server until they are ready to decrypt it, hence why I think they originally set it up using sftp (versus scp). But if scp allows the files to stay encrypted once they arrive at the remote server, then I can look into using scp for possible future file transfers.
Dennis Handly
Acclaimed Contributor

Re: encryypting files and automating file transfer to remote server

>But if scp allows the files to stay encrypted once they arrive at the remote server

I don't think so. It encrypts/decrypts as part of the transfer.

>I am closing this thread since it seems to have gotten off to a bad start.

It is better to reopen the thread and keep going, rather than create more related threads.
Jim Walls
Trusted Contributor

Re: encryypting files and automating file transfer to remote server

To use rsync, the rsync software needs to be installed at both ends of the connection.