SFTP is a protocol for transferring files using SSH to secure the commands and data that are being transferred between the client and the server. When using FTP, the data that is being transferred is not encrypted, exposing this data to eavesdropping, tampering, or message forgery. With SFTP, the data that is transferred between the client and the server is encrypted, preventing unauthorized users from accessing your data.
Components Needed
To transfer files using the SFTP protocol, you will need a server that is configured for SFTP and a client that supports it. Popular SFTP servers include FileZilla, WinSCP, and DataFreeway. The most commonly used SFTP client is PuTTY, which is available free of charge. Users who desire a more intuitive interface may opt for a more user-friendly client, such as Zephyr's PASSPORT.
How SFTP Works
There are two basic components to file transfer with SFTP; server validation and client authentication. These two components use public and private keys for authenticating communication between the client and the server. The server is validated by comparing the server's public key with the public keys stored on the client machine. The server's public key is usually contained in a file called “known_hosts” located on the server, and the client's public key is stored in an encrypted file on the local machine.
Clients can be authenticated in three different ways:
- Username and password
- Private key and passphrase
- Keyboard-interactive authentication
With username and password authentication, a user account is set up on the SFTP server. When using private key and passphrase authentication, the client's public key is added to the “authorized_keys” file on the server. Once the server validation has occurred, the client must enter their passphrase in order to load their private key and complete the authentication process.
Keyboard-interactive authentication uses the method of asking the client a series of questions, and the client must answer these questions correctly in order to be authenticated. This allows for the implementation of assorted authentication methods. For example, username and password authentication can be disabled on the server, but keyboard-interactive authentication could be used to ask the client for their username and password.
File Compression
Most SFTP Clients provide an option to enable file compression. With this option enabled, data sent by the server is compressed before sending, and decompressed at the client end. Likewise, data sent to the server is compressed first and the server decompresses it at the other end. This can help to speed up file transfers, especially with low-bandwidth connections.
SFTP Versions
There are currently two versions of the SFTP protocol: SSH-1 and SSH-2. SSH-2 is a newer, more secure implementation. SSH-1 contains a known security vulnerability, and SSH-2 is recommended for optimum security.
SFTP vs FTPS
SFTP and FTPS are two entirely different protocols.
- The standard port setting for FTP is 21. The default port for SFTP is 22
Summary
SFTP should be used when you need to transfer sensitive or confidential data between a client and a server that is configured to use SSH for secure transactions.
Transferring Files Between Computers
FTPS is a protocol for transferring files using SSL to secure the commands and data that are being transferred between the client and the server. Secure Sockets Layer (SSL) and its successor Transport Layer Security (TLS), are cryptographic protocols that provide secure communications on the Internet for such things as web browsing, e-mail, FTP and other data transfers. The SSL protocol was developed by Netscape Communications Corporation to provide security and privacy over the Internet. Due to the widespread use of SSL, it can be considered a "de facto standard".
FTPS supports channel encryption as defined in RFC 2228. With FTPS, data transfers take place in a way designed to allow both parties to authenticate each other and to prevent eavesdropping, tampering, and forgery on the messages exchanged.
How FTPS Works
When establishing an SSL secure session, the following steps occur:
1. Authenticate the server to the client.
2. Allow the client and server to select the cryptographic algorithms, or ciphers, that they both support.
3. Optionally authenticate the client to the server.
4. Use public-key encryption techniques to generate shared secrets.
5. Establish an encrypted SSL connection.
Server authentication allows a user to confirm a server's identity. SSL-enabled client software can use standard techniques of public-key cryptography to check that a server's certificate and public ID are valid and have been issued by a certificate authority (CA) listed in the client's list of trusted CAs. This confirmation might be important if the user, for example, is sending a credit card number over the network and wants to check the receiving server's identity.
The client encrypts the premaster secret with the server's public key. Only the corresponding private key can correctly decrypt the secret, so the client has some assurance that the identity associated with the public key is in fact the server with which the client is connected. Otherwise, the server cannot decrypt the premaster secret and cannot generate the symmetric keys required for the session, and the session will be terminated.
Public Key Cryptography
Public key cryptography assures private and secure data transmission through two processes: authentication and encryption. Authentication ensures that the data sender is exactly who or what it claims to be. Encryption, the most effective way to achieve data security, is the process of translating data into a secret code. To demonstrate the difference between 56-bit, 128-bit and 256-bit encryption, consider the following example:
Sending information without encryption is like sending a postcard through the mail - the contents are visible to anyone who wants to see it. Using this analogy, 56-bit encryption is like sending the information in a plain white envelope, and 256-bit encryption is like encasing your data in a lead-lined, 6-inch thick titanium safe that is being transported by an armored tank with a convoy of a hundred armed guards.
Public and Private Keys
Authentication and encryption use digital codes called "keys" - a public and a private key. The public key is used to encrypt messages, and the corresponding private key is used to decrypt them. It is important to note, however, that despite their symbiotic association, it is virtually impossible to infer the private key if you know the public key.
The public key has two major functions: validation and data encryption. As its name suggests, the public key is openly published to any party requesting one of these two functions.
The private key on the other hand, is necessary for encrypting data (also called signing) and for decrypting. Unlike the public key, this key is closely guarded.
Digital Certificates
Digital certificates are a standard way of binding a public key to a name. In order to provide a digital certificate, the data sender must apply for a digital certificate from a Certificate Authority (CA) such as VeriSign. This way, the CA acts as a neutral third party that verifies the data sender is who or what they claim to be. Once this information is verified, the CA can issue a public key certificate for that party to use. The most commonly used standard for digital certificates is X.509. A universal standard of this sort is necessary because in order to send encrypted data, you must know the recipient's public key.
Summary
FTPS should be used when you need to transfer sensitive or confidential data between a client and a server that is configured to use SSL for secure transactions.
David Muck has sinced written about articles on various topics from Computers and The Internet. Zephyr Development Corporation is a highly respected developer of advanced terminal emulation and host integration solutions for Microsoft Windows. More about SFTP Secure File Transfer:. David Muck's top article generates over 1300 views. to your Favourites.