Exercise
Downloading Files with sftp Exercise
Task
Download /etc/group from
servera with an interactive
sftp session.
- Local host
workstation- Remote host
servera
-
Open a transfer session and inspect both sides
On
workstation, prepare the local destination and connect toservera.mkdir -p /home/student/Downloads sftp student@servera lpwd pwd -
Navigate the local and remote filesystems
Point the local side at the destination directory, then point the remote side at the source directory.
lcd /home/student/Downloads lpwd cd /etc pwd -
Download and verify the group file
Confirm the file exists on the remote side, then download it and list the local directory from inside the session.
ls group get group lls -
Leave the session and clean up
Return to the shell, verify and read the downloaded file, then remove it.
bye ls -l /home/student/Downloads cat /home/student/Downloads/group rm /home/student/Downloads/group