4.3 Tools of Network Analysts: Using the CLI
🌐AP Networking Unit 4 Review
4.3 Tools of Network Analysts: Using the CLI
🌐 AP Networking
continue practicing 4.3
Multiple choice
Network analysts spend a lot of time in the command line interface (CLI), a text-based way to talk directly to a computer or remote device. It feels old-school compared to clicking around with a mouse, but it's fast, precise, and perfect for tasks like managing systems and moving files between machines. This topic focuses on how to do that file-moving part securely using two protocols that work hand in hand: SSH and SFTP.
Why the CLI Matters for Network Work
The CLI lets you get things done efficiently. Instead of opening folders and dragging files, you type one command and it happens. That speed matters when you're managing dozens of remote servers or transferring files between devices that may be across the country.
Two of the most common CLI tasks are:
- System management (configuring, checking, or fixing a device)
- File transfers (moving files from one machine to another)
Both of those tasks often involve connecting to a device you aren't sitting in front of, which means security becomes a big deal. That's where SSH comes in.
Secure Shell (SSH)
Secure Shell (SSH) is a protocol used in CLI environments to connect securely to remote systems. The key word is securely.
When you use SSH, every piece of data traveling in either direction between you and the remote device is encrypted. That means if someone intercepts the traffic, all they see is scrambled nonsense instead of your commands, your files, or your password.
SSH operates on port 22. You'll want to remember that number because SFTP uses the same port.
Secure File Transfer Protocol (SFTP)
Secure File Transfer Protocol (SFTP) is one option for moving data from one device to another. What makes it secure is that it relies on SSH to set up the connection.
Because SFTP runs on top of SSH:
- All data stays encrypted during the transfer
- Login credentials (your username and password) are encrypted too
- Nothing travels in plain text
Like SSH, SFTP operates on port 22. That makes sense because SFTP is basically using SSH's secure tunnel to send files through.
SFTP vs. Regular File Transfer
If you've heard of FTP (File Transfer Protocol), SFTP is the secure version. Plain FTP sends everything, including your password, in readable text. SFTP wraps it all in SSH encryption so your data and credentials stay private.
Starting an SFTP Session
To open an SFTP session, you need to reach the remote host (also called the target device). The command looks like this:
</>Codesftp <remote_username>@<remote_hostname_or_IP_address>
The <remote_username> is the account you want to log in as on the remote machine, and the hostname or IP address tells your computer where to find that machine.
Here's a concrete example straight from how you'd actually use it:
</>Codesftp panda@192.168.1.15
This command tries to reach the user panda at the device with IP address 192.168.1.15. The connection isn't fully established yet. You still need to supply credentials (your password). As you type the password, it will stay invisible on the screen for security. No dots, no asterisks, nothing. That's normal, not a bug. Once your credentials are accepted, the SFTP session is open and you're inside the remote device.
Navigating Inside an SFTP Session
Once you're connected, you need to move around the remote device to find what you're looking for. SFTP gives you a few CLI commands for that. These include:
ls
Shows what the current remote directory contains. Think of it like opening a folder and seeing all the files and subfolders inside.
</>Codesftp> ls reports/ notes.txt image.png backup.zip
cd
Switches to a different remote directory. If you want to go into the reports folder from the example above:
</>Codesftp> cd reports
pwd
Displays which remote working directory you're currently in. If you ever get lost, pwd tells you exactly where you are on the remote device.
</>Codesftp> pwd Remote working directory: /home/panda/reports
These three commands (ls, cd, pwd) are the basics for exploring a remote system. There are others, but these are the ones you need to know.
Moving Files with get and put
The whole point of SFTP is transferring files. Two commands handle that job:
get filename
Downloads a file from the remote device onto your local device. The direction is remote to local.
</>Codesftp> get report.pdf
This grabs report.pdf from wherever you currently are on the remote device and copies it to your own computer.
put filename
Uploads a file from your local device onto the remote device. The direction is local to remote.
</>Codesftp> put presentation.pptx
This takes presentation.pptx from your local machine and copies it up to the remote device.
Keeping get and put Straight
A lot of students mix these up. Here's a way to lock it in: think of yourself as the one running the session.
getmeans I'm getting something for me, so the file comes to you.putmeans I'm putting something over there, so the file goes to the remote device.
Putting It All Together
A typical SFTP workflow might look like this:
</>Codesftp panda@192.168.1.15 (enter password, invisible as you type) sftp> pwd Remote working directory: /home/panda sftp> ls reports/ notes.txt image.png sftp> cd reports sftp> ls q1_summary.pdf q2_summary.pdf sftp> get q2_summary.pdf (file downloads to your local machine) sftp> put new_notes.txt (file uploads to the remote machine)
In that short session, you connected securely to a remote device, figured out where you were, moved into a folder, downloaded a file you needed, and uploaded one you wanted to share. Everything, including your password and every file, was encrypted the whole time because SFTP was running on SSH through port 22.
That's the core of secure file transfer from the CLI. Once you're comfortable with the connection command, the navigation commands (ls, cd, pwd), and the transfer commands (get, put), you can handle most day-to-day file-moving tasks a network analyst runs into.
See Fiveable more often in Google
Mark Fiveable as a preferred source and Google is more likely to show you our guides in Top Stories, with a "preferred" badge in AI Mode and AI Overviews.