📖 Scenario: You work in a small company that needs to transfer files between computers securely and efficiently. You want to understand how to set up and use two common methods: FTP and SFTP.
🎯 Goal: Build a simple guide that explains the difference between FTP and SFTP, shows how to set up basic configurations, and demonstrates how to transfer files using both methods.
📋 What You'll Learn
Explain what FTP is and create a list of its key features
Explain what SFTP is and create a list of its key features
Show a simple example of FTP file transfer steps
Show a simple example of SFTP file transfer steps
💡 Why This Matters
🌍 Real World
Companies often need to move files between computers or servers. Knowing FTP and SFTP helps choose the right method for secure file transfer.
💼 Career
Network administrators, IT support, and cybersecurity professionals use FTP and SFTP knowledge to manage file transfers safely.
Progress0 / 4 steps
1
Create a list of FTP key features
Create a list called ftp_features containing these exact strings: 'File Transfer Protocol', 'Uses port 21', 'Transfers files in plain text', 'No encryption', 'Faster but less secure'.
Computer Networks
Hint
Remember to use a Python list with the exact strings given.
2
Create a list of SFTP key features
Create a list called sftp_features containing these exact strings: 'SSH File Transfer Protocol', 'Uses port 22', 'Transfers files encrypted', 'Secure connection', 'Slower but more secure'.
Computer Networks
Hint
Use a Python list with the exact strings given for SFTP features.
3
Write the FTP file transfer steps
Create a list called ftp_steps with these exact steps as strings in order: 'Connect to server on port 21', 'Login with username and password', 'Transfer files in plain text', 'Disconnect from server'.
Computer Networks
Hint
List the FTP file transfer steps exactly as given.
4
Write the SFTP file transfer steps
Create a list called sftp_steps with these exact steps as strings in order: 'Connect to server on port 22', 'Authenticate with SSH keys or password', 'Transfer files encrypted', 'Disconnect from server'.
Computer Networks
Hint
List the SFTP file transfer steps exactly as given.
Practice
(1/5)
1. Which of the following statements correctly describes the main difference between FTP and SFTP?
easy
A. Neither FTP nor SFTP encrypt data during transfer.
B. SFTP encrypts data during transfer, while FTP does not.
C. Both FTP and SFTP encrypt data equally.
D. FTP encrypts data during transfer, while SFTP does not.
Solution
Step 1: Understand FTP security
FTP is an older protocol that transfers files without encryption, making data vulnerable to interception.
Step 2: Understand SFTP security
SFTP uses encryption to protect data during transfer, making it secure over untrusted networks.
Final Answer:
SFTP encrypts data during transfer, while FTP does not. -> Option B
Quick Check:
Encryption difference = SFTP encrypts, FTP does not [OK]
Hint: Remember: S in SFTP means Secure [OK]
Common Mistakes:
Thinking FTP encrypts data
Assuming both protocols are equally secure
Confusing FTP with FTPS (which adds SSL)
2. Which of the following is the correct command to connect to a server using SFTP in a terminal?
easy
A. ftp username@server.com
B. ssh username@server.com
C. scp username@server.com
D. sftp username@server.com
Solution
Step 1: Identify SFTP command syntax
The command to start an SFTP session is sftp username@server.com, which initiates a secure file transfer connection.
Step 2: Differentiate from other commands
ftp is for FTP connections, ssh is for remote shell access, and scp copies files but is not an interactive file transfer session.
Final Answer:
sftp username@server.com -> Option D
Quick Check:
SFTP command starts with 'sftp' [OK]
Hint: SFTP command always starts with 'sftp' [OK]
Common Mistakes:
Using 'ftp' instead of 'sftp' for secure transfer
Confusing SSH with SFTP command
Using SCP which is not interactive
3. Consider this Python snippet using the paramiko library to upload a file via SFTP:
What will happen when this code runs successfully?
medium
A. The file 'local.txt' is uploaded securely to 'remote.txt' on the server.
B. The file 'remote.txt' is downloaded to 'local.txt' on the client.
C. An error occurs because paramiko does not support SFTP.
D. The connection is made but no file transfer happens.
Solution
Step 1: Understand paramiko SFTP usage
The code connects to the server using SSH, then opens an SFTP session to transfer files securely.
Step 2: Analyze the sftp.put method
sftp.put('local.txt', 'remote.txt') uploads the local file named 'local.txt' to the server as 'remote.txt'.
Final Answer:
The file 'local.txt' is uploaded securely to 'remote.txt' on the server. -> Option A
Quick Check:
sftp.put uploads local to remote [OK]
Hint: sftp.put uploads local file to server [OK]
Common Mistakes:
Confusing upload with download (put vs get)
Thinking paramiko does not support SFTP
Assuming no file transfer happens without error
4. A user tries to connect to a server using SFTP but gets an error: Permission denied (publickey). What is the most likely cause?
medium
A. The SFTP command is not installed on the client machine.
B. The user typed the wrong server address.
C. The server requires a public key for authentication, but the user did not provide one.
D. The file transfer was interrupted by network issues.
Solution
Step 1: Interpret the error message
Permission denied (publickey) means the server expects a public key for login but did not accept any provided or none was given.
Step 2: Rule out other causes
Wrong server address or missing SFTP command would cause different errors. Network interruption would not cause a permission denied error.
Final Answer:
The server requires a public key for authentication, but the user did not provide one. -> Option C
Quick Check:
Public key error means missing or wrong key [OK]
Hint: Permission denied (publickey) means missing SSH key [OK]
Common Mistakes:
Assuming network issues cause permission denied
Thinking the command is missing on client
Confusing server address errors with authentication errors
5. You need to securely transfer multiple files from your local machine to a remote server over an untrusted network. Which approach is best to ensure security and efficiency?
hard
A. Use SFTP to transfer files directly with encryption.
B. Use FTP with a VPN connection to encrypt the data.
C. Use FTP without encryption because it's faster.
D. Use HTTP to upload files through a web browser.
Solution
Step 1: Evaluate security needs
Since the network is untrusted, encryption is necessary to protect data during transfer.
Step 2: Compare transfer methods
SFTP provides built-in encryption and secure authentication, making it ideal for secure file transfer. FTP alone is not secure, even with VPN it adds complexity. HTTP is not designed for secure file transfer.
Final Answer:
Use SFTP to transfer files directly with encryption. -> Option A
Quick Check:
SFTP = secure and efficient file transfer [OK]
Hint: Choose SFTP for secure file transfer over untrusted networks [OK]
Common Mistakes:
Relying on FTP without encryption
Assuming VPN always solves FTP security
Using HTTP which is not meant for file transfer
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.