LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ftp vs ssh (https://www.linuxquestions.org/questions/linux-newbie-8/ftp-vs-ssh-754067/)

elainelaw 09-10-2009 01:05 AM

ftp vs ssh
 
I have two servers , there are many many files need to transfer between them ,the file size is small ( all files under 100KB ) , the files will be copy to remote server time by time I would like to write a script to do transfer file , can advise what method ( ftp or ssh ) that I should use , which one is more accurately , which one is more easy to control in my case ? thx

sri_ram1982 09-10-2009 01:27 AM

Hi,

Use ssh as it transmits the password in encrypted format not in clear text .or if u want to use ftp u can use it through SSN.

r3sistance 09-10-2009 02:00 AM

SSH and FTP are two completely different things, SSH is Secure SHell a remote shell protocol with security features and encryption where FTP is File Transfer Protocol used to transfer files between two machines.

I think you mean SCP (Secure CoPy) vs. FTP in which case SCP is easily the more secure of the two, their is also SFTP What is in essence FTP over an SSH tunnel and FTPS what is FTP using SSL (similar to HTTPS). SCP is secured with the same encryption as SCP is packaged into the openSSH Daemon.

elainelaw 09-10-2009 02:10 AM

thx reply,

the secure issue is not import in my case , as the data is not important , please ignore the security issure .

What I want to concern is the accurate and easy to manage / control , the ftp seems not easy to write a script to check the accurancy , but ssh can use chksum to check the accurancy of data , as the network between these servers is not stable , sometimes the files is missing to transfer to remote server , so I have to write script to check the accurancy , any transfer method is no problem for me , what one method is better for me ? thx

r3sistance 09-10-2009 02:16 AM

Unless these machines sit physically in the same network then it should be a huge issue of security, FTP is terribly bad at handling passwords and usernames. And unless you heavily lock down the accounts you are using for FTP your infact leaving the entire server open, not just the data your transferring.

As for scripts I am fairly sure you can do scripts for either of them, You can always generate a checksum on the first machine prior to transfer, send the checksum and compare it on the second in a script~.

nuwen52 09-10-2009 08:12 AM

If security is not an issue (ex: both exist on a closed network or in a VPN), then both are pretty much equal. scp and ftp are both easy enough to build into a script if needed. Some ftp clients aren't very easy to script, but ncftp is (because you can put login and password into the command line and can point at specific files). And, there are probably others.

The only thing that might still be an issue is connection. Ftp has the ability to resume a file transfer if a connection drops. I don't know of a similar option in scp. But, in either case, making an md5 checksum of the files and then checking them on the other side is a good idea. I believe both do a very good job of error checking, but an outside way to verify it is better if you need to be certain that they are exact copies.

estabroo 09-10-2009 09:32 AM

you might want to use rsync over ssh, it'll do retries and verify the data transfer and you get the security as a bonus

schneidz 09-10-2009 10:08 AM

scp does not prompt for anything (it is designed to be used in scripts. i.e.- non-interactive).
- look into setting up ssh keys.

s/ftp prompts the user for server name, user name, password, ... and will wait until user has entered in all feilds.
- it is designed to be interactive and more intuitive for users.
- but this is quite tedious for many hundreds of files.

also, i think ftp will be deprecated soon in favor of scp/ sftp (both work over ssh).
my opinion sftp is for humans and scp is for machines (scripts).

uks 09-10-2009 10:42 AM

I have used rsync for a similar kind of activity before and I think thats the most ideal for your requirement.
Give it a try.
man rsync

chrism01 09-10-2009 06:19 PM

I'd go with rsync using the ssh protocol. As said above, it'll handle the flakey cxn, because it automatically compares the src & tgt (chksums) each time and only txmits the differences. You also get the security as a free bonus.


All times are GMT -5. The time now is 01:05 AM.