[root@alarmpi ~]# systemctl enable getty@ttyAMA0
[root@alarmpi ~]# rm /etc/systemd/system/getty.target.wants/getty\@ttyAMA0.service [root@alarmpi ~]# ln -s /usr/lib/systemd/system/serial-getty\@.service \ /etc/systemd/system/getty.target.wants/serial-getty@ttyAMA0.service
[root@alarmpi ~]# cd /etc/netctl/ [root@alarmpi ~]# install -m640 examples/wireless-wpa wireless-home
Description='A simple WPA encrypted wireless connection' Interface=wlan0 Connection=wireless Security=wpa IP=dhcp ESSID='< >' # Prepend hexadecimal keys with \" # If your key starts with ", write it as '""<key>"' # See also: the section on special quoting rules in netctl.profile(5) Key='<>' # Uncomment this if your ssid is hidden #Hidden=yes
[root@alarmpi ~]# netctl start wireless-home [root@alarmpi ~]# netctl enable wireless-home
RNGD_OPTS="-o /dev/random -r /dev/hwrng"
[root@alarmpi ~]# systemctl restart rngd
[root@alarmpi ~]# rm /etc/localtime [root@alarmpi ~]# ln -s /usr/share/zoneinfo/<> /etc/localtime
[root@alarmpi ~]# systemctl start ntpd [root@alarmpi ~]# systemctl enable ntpd
[root@alarmpi ~]# pacman -Syu
[root@alarmpi ~]# fdisk /dev/mmcblk0 Welcome to fdisk (util-linux 2.24.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Command (m for help): p Disk /dev/mmcblk0: 3.8 GiB, 4072669184 bytes, 7954432 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x417ee54b Device Boot Start End Blocks Id System /dev/mmcblk0p1 2048 186367 92160 c W95 FAT32 (LBA) /dev/mmcblk0p2 186368 3667967 1740800 5 Extended /dev/mmcblk0p5 188416 3667967 1739776 83 Linux
Command (m for help): d Partition number (1,2,5, default 5): 2 Partition 2 has been deleted.
Command (m for help): n Partition type: p primary (1 primary, 0 extended, 3 free) e extended Select (default p): e Partition number (2-4, default 2): First sector (186368-7954431, default 186368): Last sector, +sectors or +size{K,M,G,T,P} (186368-7954431, default 7954431): Created a new partition 2 of type 'Extended' and of size 3.7 GiB.
Command (m for help): n Partition type: p primary (1 primary, 1 extended, 2 free) l logical (numbered from 5) Select (default p): l Adding logical partition 5 First sector (188416-7954431, default 188416): Last sector, +sectors or +size{K,M,G,T,P} (188416-7954431, default 7954431): Created a new partition 5 of type 'Linux' and of size 3.7 GiB.
Command (m for help): p Disk /dev/mmcblk0: 3.8 GiB, 4072669184 bytes, 7954432 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x417ee54b Device Boot Start End Blocks Id System /dev/mmcblk0p1 2048 186367 92160 c W95 FAT32 (LBA) /dev/mmcblk0p2 186368 7954431 3884032 5 Extended /dev/mmcblk0p5 188416 7954431 3883008 83 Linux
Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Re-reading the partition table failed.: Device or resource busy The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8). [root@alarmpi ~]# reboot
[root@alarmpi ~]# df -h / Filesystem Size Used Avail Use% Mounted on /dev/root 1.7G 536M 1005M 35% /
[root@alarmpi ~]# resize2fs /dev/mmcblk0p5 resize2fs 1.42.9 (28-Dec-2013) Filesystem at /dev/mmcblk0p5 is mounted on /; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 1 The filesystem on /dev/mmcblk0p5 is now 970752 blocks long.
[root@alarmpi ~]# df -h / Filesystem Size Used Avail Use% Mounted on /dev/root 3.7G 536M 3.0G 16% /
/dev/mmcblk0p5 / ext4 defaults,noatime 0 1
[root@alarmpi ~]# useradd -m pi [root@alarmpi ~]# passwd pi Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
[root@alarmpi ~]# pacman -S sudo
%wheel ALL=(ALL) NOPASSWD: ALL
[root@alarmpi ~]# usermod -aG wheel pi
$ ssh-copy-id pi@192.168.1.103 /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys pi@192.168.1.103's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'pi@192.168.1.103'" and check to make sure that only the key(s) you wanted were added.
[root@alarmpi ~]# nano /etc/ssh/sshd_config
PermitRootLogin no PasswordAuthentication no
[root@alarmpi ~]# systemctl restart sshd
Source: https://habr.com/ru/post/219307/
All Articles