ftp vs sftp

Hi Team,

I need the difference between ftp and sftp commands .
sam_2012Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sam Simon NasserIT Support ProfessionalCommented:
as it implies, FTP is file transfere protocol, while SFTP is secure file transfere protocol. it's like using http and https.
check this
What is sftp

Secure file transfer protocol(sftp) is a terminal program that encrypts the files that you send and recievei to a remote system. The Open-ssh package comes with three client programs. One of which is sftp. sftp is presently not implemented on the server.

Why use sftp instead of ftp?

sftp is a secure form of the ftp command.Whenever a user opens up a regular ftp session or most other TCP/IP connections, the entire transmission made between the host and the user is sent in plain text.Anyone who has the ability to snoop on the network packets can read the data, including the password information.If an unauthorized user can login, they have the oppurtunity to compromise the system.

When using ssh's sftp instead of the ftp, the entire login sesion, including transmission of password, is encrypted.It is therefore much more difficult for an outsider to observe and collect passwords from a system using ssh/sftp sessions.

How to use sftp?

sftp is similar to ftp: sftp username@ip_address at which point it will prompt you for your password. Then you receive an sftp prompt.For then on you use the same commands as in an ftp session, i.e. dir,get,put, etc.Note that the commands bin, ascii, prompt are not used in sftp.Also, the transfer of multiple files with "mget" and "mput" is not supported. If you want to transfer many files,use the "tar" command to produce a single archive for sftp.If you need a reminder which commands are available type "help" at the sftp> prompt.
https://www.ccs.uky.edu/machines/sftp.html
check here also https://www.digitalocean.com/community/tutorials/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nociSoftware EngineerCommented:
Be aware that there are few "secure" ftp implementations...

sftp is ftp across an SSH connection (which is preferred) and ftps which litterary is FTP over SSL. With firewalls involved FTPS is a nightmare because the FTP (and FTPS ) protocol use 2 connections (1 = commands & status, the other = data xfer).
and needs Firewalls too snoop the command channel... The command channel is also the one where the passwords go unencrypted.

Opt for SFTP.
0
Gerwin Jansen, EE MVETopic Advisor Commented:
What do you need it for? The main difference is just that the S stands for Secure. For @home you can use FTP just fine, for work and WAN networks, I'd use SFTP.
1
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

tfewsterCommented:
One could argue the opposite; @work, the network is probably secured by other means, but @home, you don't have professionals managing your network!

Plus setting up an FTP server takes additional work, whereas SFTP is supported out of the box for any decent OS.

i guess sam_2012 was asking because he has to convert some ftp scripts to use sftp. The most significant difference is that sftp doesn't allow .netrc files to supply the password.
https://www.experts-exchange.com/questions/21290267/Convert-ftp-scripts-to-sftp.html
0
nociSoftware EngineerCommented:
Then again sftp can use certificates (SSH Certificates, not the x509 ones) to authentcate without passwords if needed.
0
Prabhin MPEngineer-TechOPSCommented:
Hi,
The main difference between FTP and SFTP is One uses plain text and SFTP uses Secure .
The port used for FTP and SFTP are following respectively, 21 and 22. SFTP uses SSH connection to make more secure .

Hope this helps you
0
nociSoftware EngineerCommented:
@Pabhi, for FTP port 20 is needed as well, and the local system MAY act as server, unless it is forced into passive mode.
(This port 20 thingy is troublesome combined with Firewalls  and FTPS (FTP over SSL, which can be 21 or 990)
0
Prabhin MPEngineer-TechOPSCommented:
If you are using Linux machine use SFTP with port 22 .

If you are using windows machine to setup SFTP, i prefer you to install openssh server in windows which is easy to install and maintain
0
sam_2012Author Commented:
Thank you all , for wonderful discussion on FTP and SFTP.
I really appreciate.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.