Practice Exercises: Basic Computer Networking Lab: SFTP Fundamentals
Introduction
Welcome to the Basic Computer Networking lab designed to help future Site Reliability Engineers (SREs) become familiar with SFTP (Secure File Transfer Protocol). SFTP is a secure and encrypted file transfer protocol used for transferring files between a client and a server. In this lab, you will learn the fundamentals of SFTP, including connecting to a remote server and performing file transfer operations securely.
Prerequisites
- A Linux server with SSH and SFTP server software installed.
- Access to a remote Linux server for SFTP practice.
- Basic familiarity with the Linux command line.
Scenario
As a future SRE, you may encounter situations where you need to securely manage files and perform secure data transfers using SFTP. This lab provides hands-on practice to help you gain proficiency in using SFTP for secure file management and transfer tasks.
Step-by-Step Exercises with SFTP Answers
Exercise 1: Connect to a Remote Server using SFTP
- Open a terminal on your local Linux client.
- Use the SFTP client to connect to a remote Linux server (e.g.,
sftp user@ip
) using your provided username and the server's IP address. - Verify that you can successfully establish an SFTP connection to the remote server.
sftp academy@192.168.173.23
Exercise 2: List Remote Directory using SFTP
- After connecting to the remote server using SFTP, list the contents of the remote directory.
- Observe and note the files and directories in the remote directory.
ls
Exercise 3: Change Remote Directory using SFTP
- Change the remote directory to a subdirectory (e.g.,
/academy-files-ftp
) on the remote server using SFTP. - Verify that you are now in the specified remote directory.
cd academy-files-ftp
Exercise 4: Upload a File using SFTP
- Navigate to a local directory on your local Linux client.
- Use SFTP to upload a local file (e.g.,
localfile.txt
) to the current remote directory on the remote server. - Verify that the file has been successfully uploaded to the remote server.
put localfile.txt
Exercise 5: Download a File using SFTP
- Navigate to a local directory on your local Linux client.
- Use SFTP to download a remote file (e.g.,
myfile.txt
) from the current remote directory on the remote server to the local directory on your client. - Verify that the file has been successfully downloaded to your local directory.
cd
get myfile.txt
Exercise 6: Rename a Remote File using SFTP
- Rename a remote file (e.g.,
oldfile.txt
) to a new name (e.g.,newfile.txt
) in the current remote directory on the remote server using SFTP. - Verify that the file has been successfully renamed.
cd academy-files-ftp
`rename localfile.txt localfile-renamed.txt
Exercise 7: Delete a Remote File using SFTP
- Delete a remote file (e.g.,
file.txt
) from the current remote directory on the remote server using SFTP. - Verify that the file has been successfully deleted.
rm localfile-renamed.txt
Exercise 8: Create a New Remote Directory using SFTP
- Create a new remote directory (e.g.,
backup
) in the current remote directory on the remote server using SFTP. - Verify that the directory has been successfully created.
- Change 'name' into your name to make a unique directory
cd
mkdir backup-name
Exercise 9: Delete a Remote Directory using SFTP
- Delete a remote directory (e.g.,
temp
) and its contents from the current remote directory on the remote server using SFTP. - Verify that the directory has been successfully deleted.
rmdir backup-name
Exercise 10: Disconnect from the Remote Server using SFTP
- Disconnect from the remote server using SFTP and exit the SFTP client session.
- Verify that you have successfully disconnected from the remote server.
quit
Congratulations! You have successfully completed the SFTP Fundamentals lab, gaining valuable experience in using SFTP for secure file management and transfer tasks. Throughout this lab, you have learned how to connect to a remote server securely, list and navigate directories, upload and download files, and perform various file management operations.
Understanding SFTP is a crucial skill for future Site Reliability Engineers (SREs) who need to securely transfer and manage files in a networked environment. As you continue your journey in the field of computer networking, this knowledge will serve as a valuable asset in ensuring data integrity and security.
Feel free to practice these SFTP skills further and explore more advanced features of SFTP to enhance your expertise. Keep honing your networking skills, as they will be invaluable in your future endeavors as an SRE.
Thank you for participating in this lab, and we wish you success in your journey toward becoming a proficient SRE!