Skip to content

Instantly share code, notes, and snippets.

@dadyarri
Last active July 23, 2021 17:16
Show Gist options
  • Save dadyarri/3523f4db7e957c27eec2ad61b92c9787 to your computer and use it in GitHub Desktop.
Save dadyarri/3523f4db7e957c27eec2ad61b92c9787 to your computer and use it in GitHub Desktop.
Configure SSH server

Настройка SSH сервера на Arch Linux

Обновить систему

server pacman -Syyuu

server pacman -S --needed neovim git mosh htop curl wget unzip zip base-devel pacman-contrib zsh docker docker-compose python redis postgresql

server curl -s "https://archlinux.org/mirrorlist/?country=RU&country=DE&protocol=https&use_mirror_status=on" | sed -e 's/^#Server/Server/' -e '/^#/d' | rankmirrors -n 6 - > /etc/pacman.d/mirrorlist

server reboot

Настроить пользователя без прав root

server useradd <USERNAME>

server passwd <USERNAME>

server usermod -aG wheel <USERNAME>

server mkhomedir_helper <USERNAME>

server nvim /etc/sudoers

Раскомментировать строку %wheel ALL=(ALL) ALL

Загрузить ключи SSH

pc ssh-copy-id -i ~/.ssh/id_rsa.pub <USERNAME>@<IP>

Настроить Postgres

server sudo su - postgres -c "initdb --locale en_US.UTF-8 -E UTF8 -D '/var/lib/postgres/data'"

server systemctl start postgresql

server systemctl enable postgresql

server su - postgres

server createuser -dW dadyarri

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment