0Pricing
Linux Command Line Mastery · บทเรียน

การเข้าถึงระยะไกลอย่างปลอดภัย: `ssh` และ `scp`

เชี่ยวชาญ secure shell สำหรับเข้าถึงเซิร์ฟเวอร์ระยะไกลและคัดลอกไฟล์ระหว่างระบบอย่างปลอดภัย

การเข้าถึงระยะไกลอย่างปลอดภัย: `ssh` และ `scp` เป็นบทเรียน Linux Command Line Mastery ฟรีบน CoddyKit นี่คือบทเรียนที่ 3 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Linux Command Line Mastery และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Linux Command Line Mastery มีบทเรียนทั้งหมด 4 บทเรียน

บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ

Welcome to Secure Remote Access!

In this lesson, you'll learn how to connect to remote computers and transfer files securely using the Linux terminal.

We'll cover two essential tools: ssh for secure remote login and scp for secure file copying.

Secure Shell (SSH) Explained

SSH, or Secure Shell, is a network protocol that allows you to establish a secure, encrypted connection to a remote server over an unsecured network.

  • It provides a secure channel over an unsecured network by using strong cryptography.
  • It's commonly used for remote command-line login and remote command execution.

Your First SSH Connection

To connect to a remote server using SSH, you need the username on the remote server and its hostname or IP address.

The basic command is ssh username@hostname_or_ip. Try running the example below, replacing the placeholder with an actual host if you have one, or just observing the syntax.

ssh your_username@example.com

SSH with IP Address

Instead of a hostname (like example.com), you can also use the server's IP address. This is common when setting up new servers or in local networks.

The process is identical; just swap the hostname for the IP.

ssh your_username@192.168.1.100

Connecting on a Different Port

By default, SSH uses port 22. However, for security reasons or specific configurations, servers might use a different port (e.g., 2222).

You can specify a different port using the -p option followed by the port number.

ssh -p 2222 your_username@example.com

Secure Copy (SCP) Explained

SCP, or Secure Copy Protocol, is a command-line utility that allows you to securely copy files and directories between local and remote hosts, or between two remote hosts.

  • It uses SSH for data transfer and authentication.
  • This means your file transfers are encrypted and secure.

SCP: Sending Files to Remote

To copy a file from your local machine to a remote server, specify the local file path first, then the remote destination (username@host:path).

Remember to replace placeholders with your actual details.

scp local_file.txt your_username@example.com:/home/your_username/

SCP: Getting Files from Remote

To copy a file from a remote server to your local machine, the syntax is reversed: remote source first, then local destination.

You can specify a local directory, and the file will be copied into it.

scp your_username@example.com:/remote/path/file.log ./downloads/

SCP: Copying Entire Directories

If you need to copy an entire directory (folder) and its contents, you'll use the -r (recursive) option with scp.

This tells scp to copy all subdirectories and files within the specified folder.

scp -r local_folder/ your_username@example.com:/remote/backups/

Quick Check: Remote Access Tools

Which of the following commands are primarily used for secure remote access or secure file transfer in a Linux environment?

Recap: SSH and SCP Mastery

Great job! You've learned the fundamentals of secure remote access and file transfer.

  • ssh lets you securely log into and control remote servers.
  • scp allows you to securely copy files and directories between local and remote systems.
  • Both use encryption to protect your data during transfer.

These commands are indispensable for server administration and development!

คำถามที่พบบ่อย

บทเรียน “การเข้าถึงระยะไกลอย่างปลอดภัย: `ssh` และ `scp`” ฟรีหรือไม่

ใช่ — ข้อความเต็มของ “การเข้าถึงระยะไกลอย่างปลอดภัย: `ssh` และ `scp`” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Linux Command Line Mastery ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Linux Command Line Mastery มีบทเรียนทั้งหมด 4 บทเรียน

คุณจะเรียนรู้อะไรในบทเรียน “การเข้าถึงระยะไกลอย่างปลอดภัย: `ssh` และ `scp`”

เชี่ยวชาญ secure shell สำหรับเข้าถึงเซิร์ฟเวอร์ระยะไกลและคัดลอกไฟล์ระหว่างระบบอย่างปลอดภัย คุณปฏิบัติ Linux Command Line Mastery ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน

คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Linux Command Line Mastery หรือไม่

ไม่จำเป็นต้องมีประสบการณ์มาก่อน Linux Command Line Mastery บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 3 จากทั้งหมด 4 บทเรียน

บทเรียน “การเข้าถึงระยะไกลอย่างปลอดภัย: `ssh` และ `scp`” ใช้เวลานานแค่ไหน

บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย

ฉันเขียนและรันโค้ดในบทเรียน Linux Command Line Mastery นี้ได้ไหม

ได้ บทเรียน Linux Command Line Mastery ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ

บทเรียนทั้งหมดในหลักสูตรนี้

  1. การจัดการผู้ใช้และกลุ่ม: `useradd`, `usermod`, `groupadd`
  2. บทนำสู่คำสั่งเครือข่าย: `ping`, `ip`, `netstat`
  3. การเข้าถึงระยะไกลอย่างปลอดภัย: `ssh` และ `scp`
  4. สิทธิ์และเจ้าของไฟล์ด้วย chmod และ chown
← กลับไปที่ Linux Command Line Mastery