ควบคุม Raspberry Pi จากระยะไกล
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
หากคุณไม่มีจอภาพ แป้นพิมพ์ และเมาส์ที่เชื่อมต่อกับอุปกรณ์ คุณ
ยังคงควบคุมอุปกรณ์จากระยะไกลผ่าน SSH ได้
ตัวเลือกอีเทอร์เน็ต/Wi-Fi
- เปิดใช้ SSH บน Raspberry Pi แบบไม่มีส่วนหัว
(ดูส่วน "เปิดใช้งาน SSH บน Raspberry Pi แบบ Headless")
- เสียบสายอีเทอร์เน็ต
- เปิด Raspberry Pi
- ค้นหา IP ของ Raspberry Pi
ที่อยู่
- หากต้องการใช้อีเทอร์เน็ต ให้ข้ามไปยังหัวข้อถัดไป
- หากต้องการใช้ Wi-Fi ให้เชื่อมต่อผ่าน USB-TTL ก่อน
จากนั้นให้ทำดังนี้
ตัวเลือก USB-TTL
- รับสิทธิ์เข้าถึงคอนโซลโดยใช้ USB-TTL
เคเบิล
- เสียบสายอีเทอร์เน็ตหรือเชื่อมต่อเครือข่าย Wi-Fi โดยใช้คำสั่ง
เส้น
เชื่อมต่อกับ Raspberry Pi ผ่าน SSH
หากต้องการเรียกใช้คำสั่งใน Raspberry Pi คุณต้องเปิดเทอร์มินัล
บนอุปกรณ์หรือใช้การเชื่อมต่อ SSH คุณต้องใช้การเชื่อมต่อ SSH จาก
เครื่องสำหรับพัฒนาซอฟต์แวร์หากคุณไม่มีจอภาพ แป้นพิมพ์ และเมาส์
ให้กับ Raspberry Pi
ตรวจสอบว่าเปิดใช้ SSH แล้ว
ใน Raspberry Pi
ssh pi@raspberry-pi-ip-address
password: password-for-raspberry-pi
เช่น
$ ssh pi@192.168.1.101
password: raspberry
ใน Raspbian รหัสผ่านเริ่มต้นสำหรับผู้ใช้ pi
คือ raspberry
คุณควร
เปลี่ยนรหัสผ่านนี้ทันที (เรียกใช้ passwd
ในเทอร์มินัลบน Pi)
ใช้เทอร์มินัลหรือเซสชัน SSH ที่ตั้งค่าไว้ในขั้นตอนนี้เพื่อป้อน
ในส่วนที่เหลือของคู่มือนี้ ไดเรกทอรีที่ใช้งานได้สำหรับทั้ง 2 ประเภทคือ
/home/pi
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\u003cp\u003eThis guide explains how to remotely control a device, specifically a Raspberry Pi, without a monitor, keyboard, or mouse using SSH.\u003c/p\u003e\n"],["\u003cp\u003eTwo main options are provided for establishing the connection: through Ethernet/Wi-Fi, or via a USB-TTL cable.\u003c/p\u003e\n"],["\u003cp\u003eThe Ethernet/Wi-Fi option involves enabling SSH, connecting to the network, finding the device's IP address, and then connecting via SSH.\u003c/p\u003e\n"],["\u003cp\u003eThe USB-TTL option requires a USB-TTL cable for console access and then network configuration similar to the Ethernet/Wi-Fi method.\u003c/p\u003e\n"],["\u003cp\u003eOnce connected via SSH, users can run commands on the Raspberry Pi remotely from their development machine.\u003c/p\u003e\n"]]],[],null,["# Control a Raspberry Pi Remotely\n\nIf you don't have a monitor, keyboard, and mouse connected to the device, you\ncan still control the device remotely via SSH.\n\n- [Ethernet/Wi-Fi option](#headless-network-access)\n- [USB TTL option](#usb-ttl-network-access)\n\nEthernet/Wi-Fi option\n---------------------\n\n1. [Enable SSH on a headless Raspberry Pi](https://www.raspberrypi.org/documentation/remote-access/ssh/) (see section \"Enable SSH on a Headless Raspberry Pi\").\n2. Plug in an ethernet cable.\n3. Power on the Raspberry Pi.\n4. [Find the Raspberry Pi IP\n address](https://www.raspberrypi.org/documentation/remote-access/ip-address.md).\n5. If you prefer to use ethernet, skip to the next [section](#ssh).\n6. If you prefer to use Wi-Fi, first connect via [USB-TTL](#usb-ttl-network-access). Then:\n - [Connect to a Wi-Fi network using the command\n line](https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md).\n - [Find the Raspberry Pi IP address for the Wi-Fi\n connection](https://www.raspberrypi.org/documentation/remote-access/ip-address.md).\n - Re-connect via [SSH](#ssh) using this Wi-Fi IP address.\n\nUSB-TTL option\n--------------\n\n1. [Get console access using a USB-TTL\n cable](https://learn.adafruit.com/adafruits-raspberry-pi-lesson-5-using-a-console-cable/overview).\n2. Plug in an ethernet cable or [connect to a Wi-Fi network using the command\n line](https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md).\n\nConnect to the Raspberry Pi via SSH\n-----------------------------------\n\nTo run commands on the Raspberry Pi, you need to open the [terminal](https://www.raspberrypi.org/documentation/usage/terminal/)\non the device or use an SSH connection. You must use an SSH connection from your\ndevelopment machine if you do not have a monitor, keyboard, and mouse connected\nto the Raspberry Pi.\n\nMake sure [SSH is enabled](https://www.raspberrypi.org/documentation/remote-access/ssh/README.md)\non the Raspberry Pi. \n\n```\nssh pi@raspberry-pi-ip-address\n``` \n\n```\npassword: password-for-raspberry-pi\n```\n\nFor example: \n\n```\n$ ssh pi@192.168.1.101\npassword: raspberry\n```\n\nOn Raspbian, the default password for the `pi` user is `raspberry`. You should\nchange this password immediately (run `passwd` in a terminal on the Pi).\n\nUse the terminal or the SSH session you set up in this step to enter the\ncommands in the rest of this guide. The working directory for both is\n`/home/pi`."]]