Raspberry pi os lite ssh

Подключение по SSH

Работать с Raspberry Pi можно и без монитора — через SSH соединение. Рассмотрим как подключится к микрокомпьютеру из операционной системы Windows.

Включение SSH

Подготовка Raspberry Pi

Если у вас карта памяти без Raspberry Pi OS , запишите образ самостоятельно.

Поиск IP-адреса Raspberry Pi

Для подключения к Raspberry Pi необходимо знать IP-адрес платы в локальной сети.

При динамической адресации (DHCP) маршрутизатор может менять IP-адрес при каждом включении платы. В таком случае вам каждый раз придётся повторять этот шаг.

Подключение по SSH к консоли Raspberry Pi

Raspberry Pi запущена, IP-адрес известен — можно приступать к подключению по SSH.

Скачать PuTTY с официального сайта разработчиков.

При вводе пароля, вводимые символы не отображаются в консоле. Это нормально для *NIX-систем.

$

У вас всё получилось. Теперь можно управлять Raspberry Pi консольными командами Raspbian .

Подключение Raspberry Pi к Wi-Fi сети

и запомните имя интересующей вас точки доступа.

, где YourSSID — имя точки доступа, psk — пароль, key_mgmt — тип шифрования.

Если подключение выполнено успешно, вы увидите информацию о точке доступа.

Источник

Install Raspberry Pi OS, Set Up Wi-Fi, Enable and Connect with SSH

In this tutorial, you’ll learn how to get started with the Raspberry Pi by installing the operating system, setting up Wi-Fi, and enabling and connecting with SSH. You can configure everything without the need for an extra monitor, keyboard, or mouse—the Raspberry Pi will be running headless.

Updated 6 June 2022

Table of Contents

In this article, we’ll cover the following:

1) MicroSD Card for Raspberry Pi

The Raspberry Pi is a computer and like any other computer, it needs an Operating System (OS) installed.

The Pi doesn’t have built-in memory, so you’ll need a microSD card to install your OS. We’ll install the operating system on the microSD card. I recommend using a microSD card class 10 with at least 16GB of memory.

2) Installing Raspberry Pi OS

We’ll install the Raspberry Pi OS (previously called Raspbian), which is the official Raspberry Pi operating system.

Читайте также:  Как отправить email linux

1) Start by connecting the microSD card to your computer.

3) Select and download the Raspberry Pi Imager (a tool to flash the OS on the microSD card) for your computer’s operating system.

4) Click on the downloaded file to install the Raspberry Pi Imager.

5) When the installation is complete, the Raspberry Pi Imager will open.

6) Click on Choose OS to select the Operating System. Select the Raspberry Pi OS.

7) Choose storage. You must choose the microSD card where you want to install the OS.

8) The Raspberry Pi Imager allows you to access advanced settings to configure hostname, SSH, Wi-Fi, among others—click on the gear icon to open advanced settings. If your window doesn’t show the gear icon, press CtrlShiftX to open the advanced setting window.

9) You can set hostname (the default will be raspberrypi ), enable SSH, and set a password for SSH connection.

10) Additionally, set up Wi-Fi with your local network credentials, so that you can connect to your Raspberry Pi using Wi-Fi later on.

11) Set up your country and time zone. Finally, click Save.

12) After selecting the operating system, storage and advanced settings, click on write to start installing the operating system on the microSD card.

13) Wait a few seconds while it installs the Operating System.

14) When the installation is complete click on Continue. It will eject the microSD card safely.

15) Now, remove the card from your computer and insert it on your Raspberry Pi. Then, apply power to the Raspberry Pi to start it.

3) Connecting the Raspberry Pi to the Internet

If you’ve already set up the network credentials in the previous instructions, you can skip this section.

In this section, we’ll set up the Raspberry Pi to connect to the internet (your local network) when it first starts, without the need to connect a monitor, keyboard, or mouse (this is called headless).

Remove the microSD card from your computer and insert it again so that your computer can recognize the microSD card again.

1) Create a new file called wpa_supplicant.conf and paste the following.

Insert your 2-digit country code and the network credentials (SSID and password) of the network that you want the Raspberry Pi to connect to.

2) Open the microSD card folder and move the wpa_supplicant.conf file there.

4) Enabling SSH

If you’ve already enabled SSH in the previous instructions, you can skip this section.

Читайте также:  Wordpress фильтр по произвольным полям плагин

To access your Raspberry Pi remotely (via a computer on your local network) so you don’t need to connect a monitor, keyboard, or mouse to the Raspberry Pi, you need to enable SSH. SSH allows you to connect to your Raspberry Pi remotely from another machine and access the command line.

To enable SSH, you need to create a file called ssh (without any extensions) on the boot folder of the microSD card.

2) Move that file to the boot folder of the microSD card.

When the Raspberry Pi starts up, the OS will find the ssh file and will automatically activate SSH.

Now, safely eject the microSD card from your computer and insert it on the Raspberry Pi. Then, power up the Pi using a 5V DC power source.

5) Connecting via SSH to the Raspberry Pi

SSH (which stands for secure shell) is a method of establishing a communication with another computer securely. All data sent via SSH is encrypted. SSH is based on a Unix shell, so it allows you to access your Raspberry Pi files from a remote machine by using terminal commands.

This part is divided into two sections:

A) Windows

To communicate with the Raspberry Pi via SSH, you need a software to handle SSH communication. We’ll use PuTTY. You need to install it on your computer if you haven’t already.

Downloading PuTTY

If you use Windows, you need to download and install a free application called PuTTY. Here’s how to install it:

1) Open your web browser and go to www.putty.org

2) Download PuTTY. We recommend downloading the putty.exe file.

3) Run the putty.exe file to execute the software.

Connecting to the Raspberry Pi via SSH

With PuTTY installed, power up your Raspberry Pi and follow these steps:

1) Open PuTTY.

2) Select/enter the following options:

  • Host Name: raspberrypi *
  • Port: 22
  • Connection type: SSH

* raspberrypi is the default hostname. If you’ve inserted a different hostname in the installation process, you should use that instead.

3) Click Open.

4) When you connect to your Raspberry Pi for the first time, you’re prompted by a message warning you that you’re attempting to establish a connection with an unknown host. Simply click No to proceed.

5) Now, you need to login to your Raspberry Pi using the username and password you set on the installation process.

On the new window that opens, type your username and hit Enter.

6) Then, enter your password and hit Enter. You won’t see any characters showing up on the window while you type the password.

Читайте также:  Аквафор прованс какие картриджи подходят фильтр кувшин

Now you have an SSH communication established with your Raspberry Pi. This will be useful to install software on your Pi, run your programs, create folders or files, etc…

Shutting Down

To shut down your Raspberry Pi, simply type this command on the command line:

The SSH connection will be shut down right after.

B) Mac OS X/Linux

SSH (which stands for secure shell) is a method of establishing a communication with another computer securely. All data sent via SSH is encrypted.

SSH is based on a Unix shell, so it allows you to access your Raspberry Pi files from a remote machine by using terminal commands. It has grown to be one of the most popular methods for communication between different devices.

Establishing an SSH Communication

In Mac OS X and Linux, you can use the default Terminal window to establish an SSH communication, because SSH comes in all Unix-based OSes. Follow these steps:

1) Boot up your Raspberry Pi.

2) Open a new Terminal window.

3) Type the following command:

Note: if you defined a different hostname and username rather than raspberrypi and pi, you should use those instead.

4) Enter your computer password (so you can run a sudo command), and type yes.

5) When you’re asked to type a password for your Raspberry Pi type the password you’ve set previously, press Enter/Return.

When you connect your computer to your Raspberry Pi for the first time, you’re prompted by a message warning you that you’re attempting to establish a connection with an unknown host. Simply click OK to proceed

Your Terminal window should look like the Figure below:

Now you have an SSH communication established with your Raspberry Pi. This will be useful to install software on your Pi, run your programs, create folders or files, etc…

Shutting Down

To shut down your Raspberry Pi, simply type this command on the command line:

Wrapping up

In this tutorial, you’ve set up your Raspberry Pi to run headless. You’ve installed the Raspberry Pi OS, set up Wi-Fi, and enabled SSH so that you can access the Raspberry Pi command line from another machine on the same network. Finally, you established an SSH connection with the Raspberry Pi.

I hope this guide was useful. You’re now able to easily connect via SSH to your Raspberry Pi and send Linux commands (read Learning Basic Linux Commands – Raspberry Pi Cheat Sheet).

Looking for Raspberry Pi electronics projects? Check out our book: 20 Easy Raspberry Pi Projects Book

Источник

Поделиться с друзьями
КомпСовет
Adblock
detector