Last updated on Sep 7, 2024, 19:56 by mokubo3

Upload Files to Hills Server using SFTP

SFTP (Secure File Transfer Protocol) allows you to upload files to the Hills server securely. Follow the steps below to upload files or directories.

    [~] > sftp <username>@hills.ccsf.edu
    <username>@hills.ccsf.edu's password: 
    Connected to hills.ccsf.edu.
    sftp> lcd ~/Source/workspace/hills_html
    sftp> cd public_html/
    sftp> mput index.html 
    Uploading index.html to /students/<username>/public_html/index.html
    index.html                                 100% 9612   432.0KB/s   00:00    
    sftp> exit
    [~] >
    

Step 1: Connect to the Hills Server

Open a terminal and run the following command to start an SFTP session:

sftp <username>@hills.ccsf.edu

Replace <username> with your CCSF username. Once connected, you'll be in SFTP mode.

Step 2: Upload a File

To upload a file from your local machine to the server, use the put command:

put local_file

Replace local_file with the path to the file you want to upload.

Step 3: Upload a Directory

To upload an entire directory, use the -r option for recursive upload:

put -r local_directory

This will upload the directory and all its contents to the current directory on the server.

Step 4: Download a File

To download a file from the server to your local machine, use the get command:

get remote_file

Replace remote_file with the name of the file you want to download.

Step 5: Exit SFTP

To end the SFTP session, type:

exit

Questions?

If you have any questions, reach out to the CS Tutor Squad.