Arch linux arm ssh

Содержание
  1. Install Arch Linux via SSH
  2. Contents
  3. On the remote (target) machine
  4. On the local machine
  5. Installation on a headless server
  6. Prepare cloud-init configuration files
  7. Using an additional FAT formatted drive
  8. Using an additional ISO
  9. Using a single USB flash drive
  10. Using a single custom-built ISO
  11. Boot from the installation medium
  12. Install Arch Linux via SSH (Русский)
  13. На удалённой (целевой) машине
  14. На локальной машине
  15. Arch Linux на Raspberry Pi
  16. Запуск getty на ttyAMA0 (необязательно)
  17. Настройка беспроводной сети (необязательно)
  18. Аппаратный генератор случайных чисел
  19. Часовой пояс и синхронизация времени
  20. Обновление системы
  21. Расширение корневого раздела
  22. Добавление непривилегированного пользователя
  23. Установка и настройка sudo
  24. Настройка ssh
  25. Заключение
  26. theramiyer / arch-arm-rpi3-b-plus.md
  27. This comment has been minimized.
  28. Maik93 commented Sep 5, 2019
  29. This comment has been minimized.
  30. theramiyer commented Sep 6, 2019
  31. This comment has been minimized.
  32. 0pcom commented Oct 8, 2019
  33. This comment has been minimized.
  34. OfficialMuffin commented Oct 9, 2019
  35. This comment has been minimized.
  36. theramiyer commented Oct 14, 2019
  37. This comment has been minimized.
  38. theramiyer commented Oct 14, 2019
  39. This comment has been minimized.
  40. blaggacao commented Oct 28, 2019
  41. This comment has been minimized.
  42. theramiyer commented Nov 10, 2019
  43. This comment has been minimized.
  44. SleepingNewton commented Jan 13, 2020 •
  45. This comment has been minimized.
  46. open-antux commented Jan 19, 2020 •
  47. This comment has been minimized.
  48. theramiyer commented Jan 23, 2020
  49. This comment has been minimized.
  50. open-antux commented Jan 23, 2020 •
  51. This comment has been minimized.
  52. luckily82 commented Feb 6, 2020 •
  53. timedatectl set-time «2012-10-30 18:17:16»
  54. timedatectl set-timezone Zone/SubZone
  55. timedatectl set-timezone Europe/Moscow
  56. This comment has been minimized.
  57. mb720 commented Feb 13, 2020
  58. This comment has been minimized.
  59. niktob560 commented Apr 11, 2020
  60. This comment has been minimized.
  61. xetta-byte commented Apr 15, 2020
  62. This comment has been minimized.
  63. gaetanpierrard commented Jan 6, 2021
  64. This comment has been minimized.
  65. niktob560 commented Jan 6, 2021
  66. This comment has been minimized.
  67. iiwwnnaa commented Apr 27, 2021

Install Arch Linux via SSH

This article is intended to show users how to install Arch remotely via an SSH connection. Consider this approach when the host is located remotely or you wish to use the copy/paste ability of an SSH client to do the Arch install.

Contents

On the remote (target) machine

Boot the target machine into a live Arch environment via the Live CD/USB image: this will log the user in as root.

At this point, setup the network on the target machine as for example suggested in Installation guide#Connect to the internet.

Secondly, setup a root password which is needed for an SSH connection, since the default Arch password for root is empty:

Now check that PermitRootLogin yes is present (and uncommented) in /etc/ssh/sshd_config . This setting allows root login with password authentication on the SSH server.

Finally, start the openssh daemon with sshd.service , which is included by default on the live CD.

On the local machine

On the local machine, connect to the target machine via SSH with the following command:

From here one is presented with the live environment’s welcome message and is able to administer the target machine as if sitting at the physical keyboard. At this point, if the intent is to simply install Arch from the live media, follow the guide at Installation guide. If the intent is to edit an existing Linux install that got broken, follow the Install from existing Linux wiki article.

Installation on a headless server

This section describes installation of Arch Linux on a headless server without a keyboard, mouse or display. It uses an additional drive with cloud-init NoCloud configuration to automatically configure OpenSSH authorized keys and optionally iwd connection(s).

Prepare cloud-init configuration files

There are two required cloud-init configuration files: meta-data and user-data .

The meta-data file can be empty:

user-data will contain the relevant configuration:

Replace ssh-ed25519 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX with your public SSH key. To add multiple keys, simply repeat the statement as shown above.

To automatically connect to a Wi-Fi network, use the write_files: statement to create iwd network configuration files in the correct directory. For example:

Once both files are created they need to be placed on a drive with an ISO 9660 or FAT volume labeled CIDATA .

Using an additional FAT formatted drive

Use a FAT formatted drive. Copy meta-data and user-data to the drive and change the file system’s LABEL to CIDATA .

You will need to attach this drive to the headless machine in addition to the one with the official ISO.

Using an additional ISO

Create a cloud-init.iso file using xorriso from libisoburn :

Prepare the cloud-init data medium by burning cloud-init.iso to an optical disc or, if deployment options permit, use the ISO as is.

Using a single USB flash drive

If the installation image is written to e.g. a USB flash drive, provided there is enough space on the drive, and additional partition to house cloud-init data can be created.

First follow USB flash installation medium#Using the ISO as is (BIOS and UEFI) to prepare the USB flash drive installation medium.

Читайте также:  При загрузке windows не отображается пользователь

Use fdisk to edit drive’s MBR partition table without touching the ISO 9660 or invalid GPT structures:

Create a new (third) partition and set its partition type to 0c . When done, write the partition table to disk.

Format the newly created partition with a FAT file system and set its LABEL to CIDATA :

Mount the file system and copy the meta-data and user-data to the root of it.

Using a single custom-built ISO

Alternatively, create a custom ISO using Archiso. This allows using only one drive regardless of type.

Use the releng profile as basis. Place the cloud-init configuration files in airootfs/var/lib/cloud/seed/nocloud/ and build the ISO.

Boot from the installation medium

Once finished, deploy the installation medium and the cloud-init data medium (if it is separate) to the headless machine using the appropriate method.

Power up the headless machine and boot into a live Arch environment from the installation medium. Wait for a minute or so to allow the headless machine time to boot up and connect to the network.

From your existing machine (with keyboard and display) SSH into the live Arch environment on the headless server and complete the installation as described in the Installation guide.

Источник

Install Arch Linux via SSH (Русский)

Эта статья предназначена для того, чтобы показать пользователям удалённую установку Arch по SSH-соединению. Данный подход полезен, когда хост находится на удалённом расстоянии или вы хотите использовать функции SSH-клиента для копирования и вставки текста в процессе установки Arch.

На удалённой (целевой) машине

Загрузите целевую машину в Live-среду Arch с помощью образа Live CD/USB, что запустит сессию от имени root-пользователя.

На данном этапе настройте сеть на целевом компьютере, как показано, например, в разделе Руководство по установке#Соединение с интернетом.

Во-вторых, настройте пароль root, который необходим для подключения SSH, так как он по умолчанию пуст:

Теперь проверьте, что параметр PermitRootLogin yes присутствует (и раскомментирован) в файле /etc/ssh/sshd_config . Этот параметр позволяет авторизироваться пользователя root на SSH-сервере.

Наконец, запустите службу openssh — sshd.service — которая входит в live CD по умолчанию.

На локальной машине

На локальной машине подключитесь к целевому хосту по SSH с помощью следующей команды:

Теперь отобразится сообщение-приветствие live-среды и можно будет управлять целевой системой так же, как и сидя за её физической клавиатурой. Если необходимо просто установить Arch, следуйте статье Руководство по установке. Если вы хотите изменить существующую установку Linux (например, из-за каких-либо неполадок), см. статью Установка Arch из другого дистрибутива.

Источник

Arch Linux на Raspberry Pi

После довольно продолжительно использования Raspberry Pi совместно с Raspbian решил попробовать установить Arch Linux ARM. Что из этого получилось рассмотрено в статье.

Так как в месте установки RPi подключать что-либо к разъемам HDMI или RCA Video и LAN мне неудобно, я использую WiFi-подключение к сети и USB-UART для терминального доступа. Поэтому некоторые описанные шаги я отметил как необязательные.

Использованное оборудование: ноутбук с Windows, Raspberry Pi Model B, SD-карта объемом 4GB, WiFi-адаптер, UART-адаптер.

Загружаем и записываем на SD-карту образ операционной системы. В моем случае это был ArchLinuxARM-2014.01-rpi.img, запись выполнялась при помощи Win32DiskImager 0.9.5.

После установки войти в систему можно как root, пароль root. Это можно сделать как через локальный терминал так и через LAN, используя SSH.

Запуск getty на ttyAMA0 (необязательно)

Для вывода на последовательный порт загрузочных сообщений необходимо добавить в файл /boot/cmdline.txt параметр loglevel=5.

Разрешаем работу getty на последовательном порту командой:

Сигналы UART выведены на GPIO разъем Raspberry Pi:

Нужно подключить к ним USB-UART конвертер и указать в терминальной программе следующие параметры подключения: скорость 115200, 8 бит данных, 1 стоп бит, без проверки четности, без управления потоком. Подробнее как использовать PuTTY для работы через последовательный порт здесь.

Настройка беспроводной сети (необязательно)

Копируем и редактируем нужный профиль, указав в нем имя сети и пароль:

Активируем созданный профиль и разрешаем его запуск при включении:

Аппаратный генератор случайных чисел

В ArchLinux для Raspberry Pi есть поддержка аппаратного генератора случайных чисел, но демону rngd нужно указать, как его найти. Для это необходимо отредактировать файл /etc/conf.d/rngd следующим образом:

И перезапустить rngd:

Часовой пояс и синхронизация времени

Удаляем часовой пояс, назначенный по умолчанию и устанавливаем нужный:

Запускаем ntpd и разрешаем его работу при включении:

Обновление системы

Просто запускаем команду:

Расширение корневого раздела

Запускаем fdisk и выводим существующую таблицу разделов:

На SD-карте, как видно, есть основной (mmcblk0p1) и дополнительный (mmcblk0p2) разделы. Дополнительный, в свою очередь, содержит один логический (mmcblk0p5) раздел. Раздел mmcblk0p1 имеет небольшой размер, монтируется как /boot и используется при загрузке. Его модифицировать не нужно. Расширить нужно раздел mmcblk0p5, который монтируется как /.

Удаляем раздел mmcblk0p2 (при этом раздел mmcblk0p5 также удалится):

Теперь нужно создать новый дополнительный раздел, занимающий все доступное свободное пространство:

После этого внутри дополнительного, нужно создать логический раздел, так же занимающий все доступное пространство:

Проверяем, что разделы созданы правильно:

Стартовые блоки созданных разделов должны быть такими же как до внесения изменений, а общее количество блоков увеличиться.

Сохраняем изменения и выполняем перезагрузку:

После перезагрузки нужно увеличить размер файловой системы на созданном логического разделе. Текущий размер:

Читайте также:  Oracle linux mirror yandex

Имеет смысл для уменьшения количества операций записи на SD-карту установить в файле /etc/fstab параметр noatime для корневого раздела:

Добавление непривилегированного пользователя

Добавляем пользователя и устанавливаем пароль:

Установка и настройка sudo

Открыв с помощью команды visudo конфигурацию раскомментируем следующую строку:

Добавляем созданного ранее пользователя pi в группу wheel:

Это позволит пользователю pi использовать sudo для выполнения команд, требующих повышенных полномочий.

Настройка ssh

Так как SSH-ключи у меня уже были, останавливаться на их создании я не буду. Как их создать можно прочитать здесь.

Копируем публичный ключ на RPi:

Открываем файл конфигурации sshd:

Устанавливаем в нем запрет входить по ssh пользователю root и отключаем аутентификацию по паролю:

Заключение

В результате выполнения перечисленных шагов получаем RPi подключенный к WiFi сети, синхронизирующий время через интернет. На RPi можно зайти через SSH как непривилегированный пользователь имея при этом возможность вызова системных команд через sudo.

Источник

theramiyer / arch-arm-rpi3-b-plus.md

Install Arch Linux (ARM) on Raspberry Pi B+

Created 17 Aug 2018

This is a simple installation that I did on my Raspberry Pi. Of course, this is only one of the many reasons to do it.

Here are my requirements:

First, insert the memory card into your laptop. I use a memory card slot, so my device name would differ from yours if you use a USB memory card reader.

Setup the SD card

Format the SD card with fdisk

  1. List out all the drives and partitions using lsblk . Note down the name of the SD card. In my case, it is mmcblk0 .
  2. Start fdisk using sudo fdisk /dev/mmcblk0 .
  3. Delete the existing partitions by entering o at the prompt. This clears out all partitions on the card.
  4. Type p to list the partitions; there should be none.
  5. Create a new partition with n , make it primary by entering p , set it as the first partition using 1 .
  6. Press Enter to accept the default first sector. At the prompt, enter +110M to make it a 100 MB partition.
  7. Type t and then c to set the partition type to W95 FAT32 (LBA) .
  8. Now, to create the second partition, type n , then p , make it the second partition by typing 2 , and then, press Enter twice to accept the default first and the last sectors.
  9. Enter w to write this configuration to the card.
  10. Next, format the first partition as VFAT , and the second as EXT4 .

Transfer Arch Linux ARM to the card

The next step is to transfer the OS files onto the partitions.

Insert the SD card into the Pi. Now, connect a keyboard and a mouse. Connect the Pi to a display using the HDMI port. Next, connect the ethernet cable. Finally, plug in the power supply.

As soon as the login prompt arrives, enter root as the username and root as the password. You are now logged into the device.

Connect to WiFi (in case you don’t use Ethernet)

If you would rather connect the device to WiFi:

  1. Navigate to /etc/wpa_supplicant .
  2. Create a new file called anything of your choice.

Arch Linux allows SSH by default. If you would like to connect to the Pi using SSH from your personal computer instead of attaching a keyboard and a mouse and HDMI and everything, by all means, please do.

This setup may be optional. I prefer doing this because I’m used to swap.

    Setup the swapfile.

pacman is the package manager for Arch Linux.

    Add colour to pacman .

Right out of the box, Arch Linux ARM comes with two users: root and alarm . The first thing we would want to do is reset the password for root , and then, either create a new user to replace alarm , or reset the password for alarm . I go with the former approach.

    Change the password for root .

Now that we have most things set up, we will now proceed and install the necessary packages.

  1. First, install a bunch of necessary software.
  1. Install pi-bluetooth from the AUR. You should already have the packages necessary to build packages from the AUR. The package, pi-bluetooth , needs hciattach-rpi3 installed. Run the following.

Update: Looks like hciattach-rpi3 is no more available. Use bluez-utils-compat instead. Thanks to @SleepingNewton.

  1. Enable Bluetooth using sudo systemctl enable bluetooth.service .
  2. Start the Bluetooth service using sudo systemctl start bluetooth.service .
  3. Now, let us install packages necessary for audio.
  1. Enable audio at boot by adding the following line to sudo vim /boot/config.txt .

Increase the life of your SD card.

  1. Add the following line to the file.

That should get you going with Arch Linux on Raspberry Pi 3 B+.

This comment has been minimized.

Copy link Quote reply

Maik93 commented Sep 5, 2019

Hi, cool guide!
One question: when, at the beginning, you download the ArchLinux ARM image, you use the command:
wget http://archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz
I’ve checked the official site too, and it’s the same, but we are using a Pi3, so doesn’t we have to change rpi-2 in rpi-3 ? I’ve tried and it resolves in an existing package.

My main concern is that the Pi3 is 64-bit, while the Pi2 is not, so I suppose that anything should not work if exchanged.

This comment has been minimized.

Copy link Quote reply

theramiyer commented Sep 6, 2019

Hey! Thank you! I wrote this guide quite long ago. I think I copied links off of my notes, rather than from the terminal, at the time of writing the guide. Sorry about the glitch; I’ve changed that. Thank you for pointing it out. 👍 🙂

This comment has been minimized.

Copy link Quote reply

0pcom commented Oct 8, 2019

Awesome and very helpful guide!

This comment has been minimized.

Copy link Quote reply

OfficialMuffin commented Oct 9, 2019

I get a few errors when using the command sudo tar -xpf ArchLinuxARM-rpi-latest.tar.gz -C /mnt/root/
I used sudo tar -zxvf ArchLinuxARM-rpi-latest.tar.gz -C /mnt/root/ instead and it unpacks perfeclty without error.

This comment has been minimized.

Copy link Quote reply

theramiyer commented Oct 14, 2019

Oh okay, could you please tell me what error you got if you have the logs? I could add it to the documentation.

This comment has been minimized.

Copy link Quote reply

theramiyer commented Oct 14, 2019

This comment has been minimized.

Copy link Quote reply

blaggacao commented Oct 28, 2019

Little glitch:
change

archlinux-keyring might already have a newer release, so update pacman first.

This comment has been minimized.

Copy link Quote reply

theramiyer commented Nov 10, 2019

Hey, thank you! Changed it.

This comment has been minimized.

Copy link Quote reply

SleepingNewton commented Jan 13, 2020 •

I couldn’t set up Bluetooth with these instructions; the hciattach-rpi3 package is not available anymore.

I installed bluez-utils-compat instead.

This comment has been minimized.

Copy link Quote reply

open-antux commented Jan 19, 2020 •

I have two issue:

  1. sync command stuck, I don’t know why but when I do sync it take very long long time to be executed and I think that it crashes instead.
  2. Ok I avoid sync command, continue with the guide and when I boot Archlinux it stuck at: fb0 switching to vc4drmfb from simple .

How can I solve these problems?

Edit: I solved the problem with sync

This comment has been minimized.

Copy link Quote reply

theramiyer commented Jan 23, 2020

Hey, @SleepingNewton and @Superjolly002, thank you for adding your solutions. I’ll update the article. Unfortunately, I don’t have the device with me anymore, so I can’t test anything just yet. Will probably buy a 4 soon. 🙂

This comment has been minimized.

Copy link Quote reply

open-antux commented Jan 23, 2020 •

@theramiyer the bluez-firmware package doesn’t exist anymore
EDIT: I’ve notice you wrong to mention, change «Thanks to @Superjolly002» with «Thanks to @SleepingNewton»

This comment has been minimized.

Copy link Quote reply

luckily82 commented Feb 6, 2020 •

Author, You did not note about setup and sync time and select timezone:

In case if you have not file rc.conf
Для того, чтобы сравнить системное время и UTC:

$ timedatectl status
Для установки системных часов:

timedatectl set-time «2012-10-30 18:17:16»

Изменить Вашу зону и субзону:

timedatectl set-timezone Zone/SubZone

Лист доступных зон:

$ timedatectl list-timezones
Пример установки зон:

timedatectl set-timezone Europe/Moscow

This comment has been minimized.

Copy link Quote reply

mb720 commented Feb 13, 2020

Thanks for your instructions!

The image at http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-3-latest.tar.gz did not work for me. When plugging in USB power, after a short while the green ACT LED started blinking rhythmically: two short blinks separated by a longer pause. I’m not sure what it means, also after reading the flash codes.

I figured out that it works fine with a different image:

It might seem counter-intuitive to use the rpi-2 image, but it worked on my Raspberry Pi 3 B+ as opposed to the rpi-3 image.

The instructions here also use the rpi-2 image.

This comment has been minimized.

Copy link Quote reply

niktob560 commented Apr 11, 2020

wpa_supplicant requires «-c» key before the config file path

This comment has been minimized.

Copy link Quote reply

xetta-byte commented Apr 15, 2020

Can it monitor 5 ghz wifi

This comment has been minimized.

Copy link Quote reply

gaetanpierrard commented Jan 6, 2021

wpa_supplicant . & dhcpcd . works well to connect the wifi. But I have to run it every time I start the computer. What would be the elegant way to make it happen at boot automatically?

This comment has been minimized.

Copy link Quote reply

niktob560 commented Jan 6, 2021

wpa_supplicant . & dhcpcd . works well to connect the wifi. But I have to run it every time I start the computer. What would be the elegant way to make it happen at boot automatically?

We call it networkd (or netctl)

This comment has been minimized.

Copy link Quote reply

iiwwnnaa commented Apr 27, 2021

Thanks.
I installed ArchLinuxARM-rpi-2-latest.tar.gz on my raspberry pi 3B+

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

Читайте также:  Dark messiah вылетает после заставки windows 10
Оцените статью