init
This commit is contained in:
commit
38ac58fac7
232
arch-install.md
Normal file
232
arch-install.md
Normal file
@ -0,0 +1,232 @@
|
||||
# Arch install
|
||||
|
||||
## First steps
|
||||
|
||||
### Font in the console
|
||||
|
||||
~~~
|
||||
setfont ter-128n
|
||||
~~~
|
||||
|
||||
### Connecting to WiFi
|
||||
|
||||
~~~
|
||||
iwctl
|
||||
iwctl > device list
|
||||
iwctl > station <device> scan
|
||||
iwctl > station <device> get-networks
|
||||
iwctl > station <device> connect <name_point>
|
||||
~~~
|
||||
|
||||
### Time synchronization
|
||||
|
||||
~~~
|
||||
timedatectl set-ntp true
|
||||
timedatectl status
|
||||
~~~
|
||||
|
||||
## Preparing the file system
|
||||
|
||||
~~~
|
||||
fdisk /dev/sda
|
||||
~~~
|
||||
|
||||
### Creating a partition table
|
||||
|
||||
~~~
|
||||
GPT: fdisk > g
|
||||
DOS: fdisk > o
|
||||
~~~
|
||||
|
||||
### Section structure
|
||||
|
||||
~~~
|
||||
UEFI:
|
||||
/dev/sda1 - swap (6G)
|
||||
/dev/sda2 - boot (512m)
|
||||
/dev/sda3 - btrfs @,@home (all free)
|
||||
~~~
|
||||
|
||||
### DOS:
|
||||
|
||||
~~~
|
||||
/dev/sda1 - swap (6G)
|
||||
/dev/sda2 - btrfs @,@home (all free)
|
||||
~~~
|
||||
|
||||
### Creating sections
|
||||
|
||||
~~~
|
||||
fdisk > n
|
||||
~~~
|
||||
|
||||
### Specifying the types of sections
|
||||
|
||||
~~~
|
||||
swap: fdisk > t > Linux swap
|
||||
boot: fdisk > t > EFI
|
||||
~~~
|
||||
|
||||
### Creating file systems (UEFI)
|
||||
|
||||
~~~
|
||||
swap: mkswap /dev/sda1
|
||||
boot: mkfs.vfat /dev/sda2
|
||||
btffs: mkfs.btrfs -L "Arch" /dev/sda3
|
||||
~~~
|
||||
|
||||
### Connect SWAP
|
||||
|
||||
~~~
|
||||
swapon /dev/sda1
|
||||
~~~
|
||||
|
||||
### Creating partitions BTRFS
|
||||
|
||||
~~~
|
||||
mount /dev/sda3 /mnt
|
||||
btrfs subvolume create /mnt/@
|
||||
btrfs subvolume create /mnt/@home
|
||||
mkdir /mnt/@/{boot,home}
|
||||
umount -R /mnt
|
||||
~~~
|
||||
|
||||
### Mounting partitions
|
||||
|
||||
~~~
|
||||
mount -o subvol=/@,ssd,noatime,compress=lzo,space_cache=v2,discard=async /dev/sda3 /mnt
|
||||
mount -o subvol=/@home,ssd,noatime,compress=lzo,space_cache=v2,discard=async /dev/sda3 /mnt/home
|
||||
mount /dev/sda2 /mnt/boot
|
||||
~~~
|
||||
|
||||
## Configere system
|
||||
|
||||
### Sorting mirrors for installing packages
|
||||
|
||||
~~~
|
||||
reflector -c Russia -c Belarus -a 5 --sort rate --save /etc/pacman.d/mirrorlist
|
||||
~~~
|
||||
|
||||
### Install base packages
|
||||
|
||||
~~~
|
||||
pacstrap /mnt base linux linux-firmware base-devel btrf-progs dhcpcd iwd vim terminus-font
|
||||
~~~
|
||||
|
||||
### Generating a partition mount file
|
||||
|
||||
~~~
|
||||
genfstab -U /mnt >> /mnt/etc/fstab
|
||||
~~~
|
||||
|
||||
### Change root dir
|
||||
|
||||
~~~
|
||||
arch-chroot /mnt
|
||||
~~~
|
||||
|
||||
### Change password
|
||||
|
||||
~~~
|
||||
passwd
|
||||
~~~
|
||||
|
||||
### Internet Activation
|
||||
|
||||
~~~
|
||||
systemctl enable dhcpcd
|
||||
systemctl enable iwd
|
||||
~~~
|
||||
|
||||
### We set the time zone and synchronize the time
|
||||
|
||||
~~~
|
||||
ln -sf /usr/share/zoneinfo/Europe/Moscow /etc/localtime
|
||||
hwclock --systohc --utc
|
||||
~~~
|
||||
|
||||
### Name host
|
||||
|
||||
~~~
|
||||
echo arch > /etc/hostname
|
||||
~~~
|
||||
|
||||
### Settings hosts
|
||||
|
||||
~~~
|
||||
vim /etc/hosts
|
||||
--
|
||||
127.0.0.1 localhost
|
||||
::1 localhost
|
||||
127.0.1.1 arch.localdomain arch
|
||||
~~~
|
||||
|
||||
### Generating locales
|
||||
|
||||
~~~
|
||||
vim /etc/locale.gen
|
||||
locale-gen
|
||||
~~~
|
||||
|
||||
### Install locale
|
||||
|
||||
~~~
|
||||
vim /etc/locale.conf
|
||||
-->
|
||||
LANG=en_US.UTF-8
|
||||
LANGUGE=en_US
|
||||
LC_ALL=C
|
||||
LC_COLLATE=C
|
||||
~~~
|
||||
|
||||
### Settings console
|
||||
|
||||
~~~
|
||||
vim /etc/vconsole.conf
|
||||
-->
|
||||
KEYMAP=us
|
||||
FONT=ter-128n
|
||||
~~~
|
||||
|
||||
#### BTRFS
|
||||
|
||||
~~~
|
||||
vim /etc/mkinitcpio.conf
|
||||
-->
|
||||
MODULES=(btrfs)
|
||||
~~~
|
||||
|
||||
### Editing hooks
|
||||
|
||||
~~~
|
||||
vim /etc/mkinitcpio.conf
|
||||
-->
|
||||
HUKS=(...keymap)
|
||||
~~~
|
||||
|
||||
### Creating the initial environment
|
||||
|
||||
~~~
|
||||
mkinitcpio -P
|
||||
~~~
|
||||
|
||||
### Installing the loader
|
||||
|
||||
~~~
|
||||
pacman -S grub
|
||||
grub-install /dev/sda
|
||||
|
||||
-- Если UEFI:
|
||||
pacman -S efibootmgr
|
||||
grub-install --efi-directory=/boot
|
||||
|
||||
grub-mkconfig -o /boot/grub/grub.cfg
|
||||
~~~
|
||||
|
||||
## Completion
|
||||
|
||||
~~~
|
||||
exit
|
||||
umount -R /mnt
|
||||
reboot
|
||||
~~~
|
25
arch-post-install.md
Normal file
25
arch-post-install.md
Normal file
@ -0,0 +1,25 @@
|
||||
# Arch post install
|
||||
|
||||
## Install utils
|
||||
~~~
|
||||
sudo pacman -S \
|
||||
xorg xorg-xinit \
|
||||
nitrogen picom polybar i3-wm \
|
||||
bluez bluez-tools \
|
||||
pulseaudio
|
||||
|
||||
sudo systemct enable bluetooth
|
||||
~~~
|
||||
|
||||
## AUR
|
||||
|
||||
~~~
|
||||
git clone https://aur.archlinux.org/yay.git
|
||||
cd yay
|
||||
makepkg -si
|
||||
~~~
|
||||
|
||||
## Yandex Browser
|
||||
~~~
|
||||
yay -S yandex-browser
|
||||
~~~
|
23
criptsetup.md
Normal file
23
criptsetup.md
Normal file
@ -0,0 +1,23 @@
|
||||
# Cryptsetup
|
||||
|
||||
## Crypt disk.
|
||||
~~~
|
||||
cryptsetup -y -v luksFormat /dev/sda1
|
||||
|
||||
# (Enter YES, uppercase)
|
||||
~~~
|
||||
|
||||
## Open disk.
|
||||
~~~
|
||||
cryptsetup open /dev/sda1 [name_disk]
|
||||
~~~
|
||||
|
||||
## Create file system.
|
||||
~~~
|
||||
mkfs.btrfs -f /dev/mapper/[name_disk]
|
||||
~~~
|
||||
|
||||
## Mount file system.
|
||||
~~~
|
||||
mount /dev/mapper/[name_disk] /mnt/[name_directory]
|
||||
~~~
|
16
letsencrypt.md
Normal file
16
letsencrypt.md
Normal file
@ -0,0 +1,16 @@
|
||||
# Letsencrypt
|
||||
|
||||
## Certbot install
|
||||
~~~
|
||||
pacman -S certbot
|
||||
~~~
|
||||
|
||||
## Certbot setup ssl
|
||||
~~~
|
||||
certbot certonly
|
||||
~~~
|
||||
|
||||
## Certbot update ssl
|
||||
~~~
|
||||
certbot renew --dry-run
|
||||
~~~
|
15
pass.md
Normal file
15
pass.md
Normal file
@ -0,0 +1,15 @@
|
||||
# Pass
|
||||
|
||||
## GPG install
|
||||
|
||||
~~~
|
||||
pacman -S gnupg
|
||||
gpg --import /path/private/or/public/keys
|
||||
~~~
|
||||
|
||||
## Failed key (There is no assurance this key belongs to the named user)
|
||||
|
||||
~~~
|
||||
gpg --edit-key <KEY_ID>
|
||||
gpg> trust
|
||||
~~~
|
24
touchpad.md
Normal file
24
touchpad.md
Normal file
@ -0,0 +1,24 @@
|
||||
# Settings touchpad
|
||||
|
||||
## Get device names
|
||||
~~~
|
||||
libinput list-devices | grep Device
|
||||
~~~
|
||||
|
||||
## Create config
|
||||
~~~
|
||||
vim /etc/X11/xorg.conf.d/30-touchpad.conf
|
||||
|
||||
---
|
||||
Section "InputClass"
|
||||
Identifier "<device name>"
|
||||
MatchIsTouchpad "on"
|
||||
Driver "libinput"
|
||||
Option "Tapping" "on"
|
||||
Option "NaturalScrolling" "true"
|
||||
Option "PinchZoom" "on"
|
||||
Option "AccelSpeed" "0.5"
|
||||
EndSection
|
||||
~~~
|
||||
|
||||
reboot
|
126
wireguard.md
Normal file
126
wireguard.md
Normal file
@ -0,0 +1,126 @@
|
||||
# Текстовая инструкция по настройке Wireguard
|
||||
|
||||
[видео: https://www.youtube.com/watch?v=5Aql0V-ta8A](https://www.youtube.com/watch?v=5Aql0V-ta8A)
|
||||
|
||||
## Обновляем сервер:
|
||||
~~~
|
||||
apt update && apt upgrade -y
|
||||
~~~
|
||||
|
||||
## Ставим wireguard:
|
||||
|
||||
~~~
|
||||
apt install wireguard
|
||||
~~~
|
||||
|
||||
## Генерим ключи сервера:
|
||||
|
||||
~~~
|
||||
wg genkey | tee /etc/wireguard/privatekey | wg pubkey | tee /etc/wireguard/publickey
|
||||
~~~
|
||||
|
||||
## Проставляем права на приватный ключ:
|
||||
|
||||
~~~
|
||||
chmod 600 /etc/wireguard/privatekey
|
||||
~~~
|
||||
|
||||
# Создаём конфиг сервера:
|
||||
|
||||
~~~
|
||||
vim /etc/wireguard/wg0.conf
|
||||
|
||||
[Interface]
|
||||
PrivateKey = <privatekey>
|
||||
Address = 10.0.0.1/24
|
||||
ListenPort = 51831
|
||||
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
|
||||
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
|
||||
~~~
|
||||
|
||||
Вставляем вместо <privatekey> содержимое файла /etc/wireguard/privatekey
|
||||
|
||||
## Настраиваем IP форвардинг:
|
||||
|
||||
~~~
|
||||
echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
|
||||
sysctl -p
|
||||
~~~
|
||||
|
||||
## Включаем systemd демон с wireguard:
|
||||
|
||||
~~~
|
||||
systemctl enable wg-quick@wg0.service
|
||||
systemctl start wg-quick@wg0.service
|
||||
systemctl status wg-quick@wg0.service
|
||||
~~~
|
||||
|
||||
## Создаём ключи клиента:
|
||||
|
||||
~~~
|
||||
wg genkey | tee /etc/wireguard/goloburdin_privatekey | wg pubkey | tee /etc/wireguard/goloburdin_publickey
|
||||
~~~
|
||||
|
||||
## Добавляем в конфиг сервера клиента:
|
||||
|
||||
~~~
|
||||
vim /etc/wireguard/wg0.conf
|
||||
|
||||
[Peer]
|
||||
PublicKey = <goloburdin_publickey>
|
||||
AllowedIPs = 10.0.0.2/32
|
||||
~~~
|
||||
|
||||
Вместо <goloburdin_publickey> — заменяем на содержимое файла /etc/wireguard/goloburdin_publickey
|
||||
|
||||
## Перезагружаем systemd сервис с wireguard:
|
||||
|
||||
~~~
|
||||
systemctl restart wg-quick@wg0
|
||||
systemctl status wg-quick@wg0
|
||||
~~~
|
||||
|
||||
## Создание клиента:
|
||||
|
||||
На локальной машине (например, на ноутбуке) создаём текстовый файл с конфигом клиента:
|
||||
|
||||
~~~
|
||||
vim goloburdin_wb.conf
|
||||
~~~
|
||||
|
||||
## Полная маршрутизация трафика:
|
||||
|
||||
~~~
|
||||
[Interface]
|
||||
PrivateKey = <CLIENT-PRIVATE-KEY>
|
||||
Address = 10.0.0.2/32
|
||||
DNS = 8.8.8.8
|
||||
|
||||
[Peer]
|
||||
PublicKey = <SERVER-PUBKEY>
|
||||
Endpoint = <SERVER-IP>:51830
|
||||
AllowedIPs = 0.0.0.0/0
|
||||
PersistentKeepalive = 20
|
||||
|
||||
~~~
|
||||
|
||||
Здесь <CLIENT-PRIVATE-KEY> заменяем на приватный ключ клиента, то есть содержимое файла /etc/wireguard/goloburdin_privatekey на сервере.
|
||||
<SERVER-PUBKEY> заменяем на публичный ключ сервера, то есть на содержимое файла /etc/wireguard/publickey на сервере. <SERVER-IP> заменяем на IP сервера.
|
||||
|
||||
## Что бы сделать частичную маршрутизацию:
|
||||
|
||||
Убрать DNS и изменить AllowedIPs на 10.0.0.0/24
|
||||
|
||||
## Теперь нам нужно перенести этот конфиг на смартфон:
|
||||
|
||||
~~~
|
||||
apt install qrencode
|
||||
~~~
|
||||
|
||||
И потом выбрать конфиг и сгенерировать из него QR код
|
||||
|
||||
~~~
|
||||
qrencode -t ansiutf8 < iphone.conf
|
||||
~~~
|
||||
|
||||
После этого в консоли мы увидим QR код и нам остается только отсканировать его через WireGuard на мобильном приложении.
|
Loading…
Reference in New Issue
Block a user