Exercise

Downloading Files with sftp Exercise

Task

Download /etc/group from servera with an interactive sftp session.

Local host
workstation
Remote host
servera
  1. Open a transfer session and inspect both sides

    On workstation, prepare the local destination and connect to servera.

    mkdir -p /home/student/Downloads
    sftp student@servera
    lpwd
    pwd
  2. 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
  3. 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
  4. 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