4 months ago
by admin
Інструкція зі створення SSH-ключів та копіювання їх на віддалений сервер
1. Створення SSH-ключів
Відкрийте термінал та виконайте наступну команду:
ssh-keygen -t ed25519 -C "ваш_коментар@приклад"
(Або для старіших систем використайте ssh-keygen -t rsa -b 4096 -C "ваш_email@приклад")
- Натисніть Enter, щоб зберегти ключ у стандартній папці (
~/.ssh/).
- Введіть пароль (опціонально, але рекомендовано для додаткової безпеки).
Після виконання у папці ~/.ssh/ з’являться два файли:
-
id_ed25519 (або id_rsa) – приватний ключ (нікому не передавати!).
-
id_ed25519.pub (або id_rsa.pub) – публічний ключ (копіюємо на сервер).
2. Копіювання ключа на сервер
Використайте утиліту ssh-copy-id:
ssh-copy-id -i ~/.ssh/id_ed25519.pub username@remote_server_ip
(Замініть username та remote_server_ip на свої дані)
Якщо ssh-copy-id недоступна, скопіюйте ключ вручну:
cat ~/.ssh/id_ed25519.pub | ssh username@remote_server_ip "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys"
3. Перевірка підключення
Спробуйте підключитись до сервера:
ssh username@remote_server_ip
Якщо все правильно, сервер не запросить пароль (якщо не встановлено пароль на ключ).
4. Вимкнення авторизації по паролю (опціонально)
Для підвищення безпеки на сервері у файлі /etc/ssh/sshd_config змініть:
PasswordAuthentication no
Потім перезавантажте SSH:
sudo systemctl restart sshd
Готово! Тепер ви можете підключатись до сервера за допомогою SSH-ключа. 🔑
Category: Linux | Comments: 0
5 months ago
by admin
https://github.com/gpakosz/.tmux
cd
git clone --single-branch <https://github.com/gpakosz/.tmux.git>
ln -s -f .tmux/.tmux.conf
cp .tmux/.tmux.conf.local .
Bindings
tmux may be controlled from an attached client by using a key combination of a
prefix key, followed by a command key. This configuration uses C-a as a
secondary prefix while keeping C-b as the default prefix. In the following
list of key bindings:
<prefix> means you have to either hit Ctrl + a or Ctrl + b<prefix> c means you have to hit Ctrl + a or Ctrl + b followed by c<prefix> C-c means you have to hit Ctrl + a or Ctrl + b followed by Ctrl + c
This configuration uses the following bindings:
<prefix> e opens the .local customization file copy with the editor
defined by the EDITOR environment variable (defaults to vim when empty)<prefix> r reloads the configurationC-l clears both the screen and the tmux history<prefix> C-c creates a new session<prefix> C-f lets you switch to another session by name<prefix> C-h and <prefix> C-l let you navigate windows (default
<prefix> n is unbound and <prefix> p is repurposed)<prefix> Tab brings you to the last active window<prefix> - splits the current pane vertically<prefix> _ splits the current pane horizontally<prefix> h, <prefix> j, <prefix> k and <prefix> l let you navigate
panes ala Vim<prefix> H, <prefix> J, <prefix> K, <prefix> L let you resize panes<prefix> < and <prefix> > let you swap panes<prefix> + maximizes the current pane to a new window<prefix> m toggles mouse mode on or off<prefix> U launches Urlscan (preferred) or Urlview, if available<prefix> F launches Facebook PathPicker, if available<prefix> Enter enters copy-mode<prefix> b lists the paste-buffers<prefix> p pastes from the top paste-buffer<prefix> P lets you choose the paste-buffer to paste from
Additionally, copy-mode-vi matches my own Vim configuration
Bindings for copy-mode-vi:
v begins selection / visual modeC-v toggles between blockwise visual mode and visual modeH jumps to the start of lineL jumps to the end of liney copies the selection to the top paste-bufferEscape cancels the current operation
It's also possible to preserve the tmux stock bindings by setting the
tmux_conf_preserve_stock_bindings variable to true in your .local
customization file copy.
Category: Linux | Comments: 0
5 months ago
by admin
Installation
The
default scrolling behaviour runs through the previous commands instead
of scrolling the terminal output. Enable sane scrolling behaviour with
this config line.
Usage
Commands
Here is a summary of the most common commands that you'll want to use.
| Command | Function |
|---|
| tmux | Start a new session |
tmux new -s name | Start a new named session |
| tmux ls | List sessions |
| tmux attach | Attach to the most recently used session |
tmux attach -t name | Attach to a named session |
tmux kill-session -t name | Kill a named session |
Key bindings
Tmux
also have a lot of keybindings to help you manage all sessions and
windows. Here are the essential bindings that you'll want to learn. The
default key combination to initiate a command is Ctrl+b / control+b.
| Command | Function |
|---|
| Ctrl+b ? | List all key bindings. |
| Ctrl-b d | Detach from the current session |
| Ctrl+b % | Add a new pane to the right |
| Ctrl+b " | Add a new pane to the bottom |
| Ctrl+b % | Split pane horizontally |
| Ctrl+b " | Split pane vertically |
| Ctrl+b o | Switch to the next pane |
| Ctrl+b ; | Move between the current and previous pane |
Ctrl+b arrow-key | Navigate between the panes |
| Ctrl+b x | Ctrl+b x Close the current pane |
| Ctrl-b c | Create a new window |
| Ctrl-b w | Switch between sessions and windows |
Category: Linux | Comments: 0
8 months ago
by admin
☁ ~ sudo pacman -S ttf-jetbrains-mono-nerd-3.3.0-1
Category: Linux | Comments: 0
11 months ago
by admin
Шпаргалка встановлення Arhc Linux
У разі потреби - збільшення шрифту:
setfont iso01-12x22.psfu.gz
1. Підключення інтернет wi-fi
iwctl
device list
station wlan0 scan
station wlan0 get-networks
station wlan0 connect UPCCE2B671E
station wlan0 show
exit //or CTRL + C
2. Час
Для початку робимо синхронізацію із сервером NTP:
timedatectl set-ntp true
timedatectl set-timezone Europe/Kiev
timedatectl status
3. cfdisk
lsblk
cfdisk /dev/nvme0n1 //створення розділів
efi
swap
root
home
4. Форматування та монтування розділів
mkfs.vfat /dev/nvme0n1p2
mkfs.ext4 /dev/nvme0n1p3
(mk.swap /dev/...)
mount /dev/nvme0n1p3 /mnt
mkdir -p /mnt/boot/efi
mount /dev/nvme0n1p2 /mnt/boot/efi
mkdir /mnt/home
mount /dev/nvme0n1p1 /mnt/home
(swapon /dev/...)
5. Встановлення пакетів
pacstrap -K /mnt base base-devel linux linux-firmware
linux-headers dhcpcd vim bash-completion grub efibootmgr xorg plasma
ttf-jetbrains-mono-nerd ttf-ubuntu-font-family ttf-hack ttf-dejavu
ttf-opensans kate konsole dolphin chromium firefox git zsh openssh xclip fastfetch
6.
genfstab -U /mnt >> /mnt/etc/fstab
vim /mnt/etc/fstab
7. Перехід у встановлену систему
arch-chroot /mnt
8. Часова зона
ln -sf /usr/share/zoneinfo/Europe/Kiev /etc/localtime
ls /usr/share/zoneinfo
# Виконайте hwclock(8) щоб створити /etc/adjtime:
hwclock --systohc
9. Мова
vim /etc/locale.gen (uk_UA.UTF-8 UTF-8, en_US.UTF-8 UTF-8)
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf (мова системи)
10.Користувачі
passwd (пароль для root)
vim /etc/sudoers (розкоментувати %wheel ALL=(ALL) ALL)
useradd -mg users -G wheel peturik
passwd peturik
11. Назва комп'ютреа
vim /etc/hostname (напр. precision_5540)
vim /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 precision_5540.localdomain precision_5540
12.
systemctl enable NetworkManager dhcpcd sddm
13. Bootloader install
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ArchLinux
grub-mkconfig -o /boot/grub/grub.cfg
mkinitcpio -P
exit
umount -R /mnt
reboot
https://habr.com/ru/articles/805671/
https://habr.com/ru/articles/819729/
https://wiki.archlinux.org/title/Installation_guide
https://dou.ua/forums/topic/44723/
Category: Linux | Comments: 0