From 3a10515d6e87f003b20cfdd5259ed5eb260e06b0 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 25 Sep 2023 21:36:25 +0300 Subject: [PATCH] shell --- content/posts/ald-pro.md | 21 ++++++++++----------- content/posts/astra-freeipa.md | 5 ++--- content/posts/bareos-install.md | 5 +++-- content/posts/cifs-automount.md | 11 +++++------ content/posts/dhcp-resolv.md | 7 +++---- content/posts/github-ssh-auth.md | 6 +++--- content/posts/ip-command.md | 8 ++++---- content/posts/linux-krb5.md | 17 +++++++---------- content/posts/linux-network.md | 6 +++--- content/posts/pfx-to-pem.md | 8 ++++---- content/posts/run-nologin.md | 4 ++-- content/posts/windows-disable-shutdown.md | 2 +- 12 files changed, 47 insertions(+), 53 deletions(-) diff --git a/content/posts/ald-pro.md b/content/posts/ald-pro.md index 4c97119..e6f58d6 100644 --- a/content/posts/ald-pro.md +++ b/content/posts/ald-pro.md @@ -6,10 +6,10 @@ tags: [linux, astra, krb5] --- ## Создания сетевой видимости -```shell - . +В файл `/etc/hosts` необходимо добавить ip и fqdn DC: -# /etc/hosts +```sh + . ``` ## Смена хостнейма @@ -18,20 +18,20 @@ hostnamectl set-hostname . ``` ## Добавление репозиториев ALD Pro -```shell +В файл `/etc/apt/sources.list.d/aldpro.list` необходимо добавить репозиторий ALD Pro: + +```sh deb https://download.astralinux.ru/aldpro/stable/repository-main/ 1.0.0 main deb https://download.astralinux.ru/aldpro/stable/repository-extended/ generic main - -# /etc/apt/sources.list.d/aldpro.list ``` ## Выставление приоритета репозиториев -```shell +В файле `/etc/apt/preferences.d/aldpro` необходимо выставить приоритет репозиториев: + +```sh Package: * Pin: release n=generic Pin-Priority: 900 - -# /etc/apt/preferences.d/aldpro ``` ## Установка пакета @@ -44,6 +44,5 @@ DEBIAN_FRONTEND=noninteractive apt-get install -q -y aldpro-mp сервер ALD Pro будет доступен по адресу: `https://.` ```shell -/opt/rbta/aldpro/mp/bin/aldpro-server-install.sh \ - -d -n -p --ip +/opt/rbta/aldpro/mp/bin/aldpro-server-install.sh -d -n -p --ip ``` diff --git a/content/posts/astra-freeipa.md b/content/posts/astra-freeipa.md index 76eda08..810dfb2 100644 --- a/content/posts/astra-freeipa.md +++ b/content/posts/astra-freeipa.md @@ -7,12 +7,11 @@ tags: [linux, astra, krb5, freeipa] ## Общая настройка ### Создания сетевой видимости +На клиенте и DC необходимо в файл `/etc/hosts` добавить оба ip и fqdn: -```shell +```sh . . - -# /etc/hosts ``` ## Настройка cервера diff --git a/content/posts/bareos-install.md b/content/posts/bareos-install.md index c1b8926..136afe7 100644 --- a/content/posts/bareos-install.md +++ b/content/posts/bareos-install.md @@ -25,6 +25,7 @@ systemctl enable --now postgresql bareos-director bareos-filedaemon bareos-stora ### Создание пользователя для Bareos-webui и конфига клиента Веб Bareos'а находится по адресу: `http:///bareos-webui/` + ```shell bconsole configure add console name= password= profile=webui-admin tlsenable=no @@ -34,6 +35,8 @@ exit ``` ### Бэкап определённой папки +В файл `/etc/bareos/bareos-dir.d/fileset/.conf` необходимо добавить настройку бэкапа определённой папки: + ```shell FileSet { Name = "" @@ -45,8 +48,6 @@ FileSet { File = "" } } - -# /etc/bareos/bareos-dir.d/fileset/.conf ``` ## Конфигурация клиента diff --git a/content/posts/cifs-automount.md b/content/posts/cifs-automount.md index 555fea8..5c6a6c5 100644 --- a/content/posts/cifs-automount.md +++ b/content/posts/cifs-automount.md @@ -10,12 +10,12 @@ apt install cifs-utils -y ``` ## Создание файла с данными УЗ -```shell +В файл `/root/.smbuser` необходимо добавить данные УЗ для подключения к шаре: + +```sh username= password= domain= - -# /root/.smbuser ``` ## Смена прав на файл с данными УЗ @@ -24,10 +24,9 @@ sudo chmod 0400 /root/.smbuser ``` ## Развёртывание -```shell +В `/etc/fstab` необходимо добавить строку подключения к шаре: +```sh //
/ cifs credentials=/root/.smbuser,uid=,gid= 0 0 - -# /etc/fstab ``` ## Монтирование всех директорий diff --git a/content/posts/dhcp-resolv.md b/content/posts/dhcp-resolv.md index 0d8a7e4..cc3e9c0 100644 --- a/content/posts/dhcp-resolv.md +++ b/content/posts/dhcp-resolv.md @@ -6,14 +6,13 @@ tags: [linux] --- ## Конфигурация клиента Неприятно, когда конфиг не даёт поменять себя ручками, да? +В `/etc/dhcp/dhclient.conf` необходимо добавить строки перезаписи: -```bash +```sh supersede domain-name-servers , ; supersede domain-name ""; - -# /etc/dhcp/dhclient.conf ``` -```bash +```shell systemctl restart networking ``` diff --git a/content/posts/github-ssh-auth.md b/content/posts/github-ssh-auth.md index d89baf6..650821a 100644 --- a/content/posts/github-ssh-auth.md +++ b/content/posts/github-ssh-auth.md @@ -6,13 +6,13 @@ tags: [linux, git, ssh] --- ## Генерация ключа -```bash +```shell ssh-keygen -t ed25519 -C "@" ``` ## Вывод публичного ключа -```bash +```shell cat ~/.ssh/id_ed25519.pub ``` @@ -22,6 +22,6 @@ cat ~/.ssh/id_ed25519.pub ## Аутентификация в GitHub -```bash +```shell git remote set-url origin git@github.com:/.git ``` diff --git a/content/posts/ip-command.md b/content/posts/ip-command.md index c4ef89d..bfda90e 100644 --- a/content/posts/ip-command.md +++ b/content/posts/ip-command.md @@ -5,25 +5,25 @@ description: Команда ip в Linux tags: [linux] --- ## Показать все интерфейсы -```bash +```shell ip a ip l ``` ## Показать информацию по конкретному интерфейсу -```bash +```shell ip a show ip l show ``` ## Изменить статус сетевого интерфейса -```bash +```shell ip l set down ip l set up ``` ## Добавить или удалить адрес -```bash +```shell ip a add dev ip a add brd dev ip a del dev diff --git a/content/posts/linux-krb5.md b/content/posts/linux-krb5.md index 593496f..ee11576 100644 --- a/content/posts/linux-krb5.md +++ b/content/posts/linux-krb5.md @@ -27,16 +27,15 @@ hostnamectl set-hostname ``` ### Правка файла hosts -Вместо правки файла hosts можно поднять DNS-сервер и сделать записи там. -```shell +Вместо правки файла `/etc/hosts` можно поднять DNS-сервер и сделать записи там. +```sh - -# /etc/hosts ``` ### Редактирование конфига Kerberos -```shell +В `/etc/krb5.conf` необходимо добавить данные а реалме и kdc: +```sh [libdefaults] default_realm = @@ -51,8 +50,6 @@ hostnamectl set-hostname [domain_realm] = . = - -# /etc/krb5.conf ``` ## Создание нового реалма (на сервере) @@ -70,10 +67,10 @@ quit ``` ### Разрешение административных прав -```shell -/admin +Добавляем администратора в `/etc/krb5kdc/kadm5.acl`: -# /etc/krb5kdc/kadm5.acl +```sh +/admin ``` ## Получение билета diff --git a/content/posts/linux-network.md b/content/posts/linux-network.md index 6f4d360..02213d9 100644 --- a/content/posts/linux-network.md +++ b/content/posts/linux-network.md @@ -5,7 +5,7 @@ description: Путём правки конфигурационных файло tags: [linux] --- ## Настройка DNS и домена -```bash +```shell search nameserver @@ -13,7 +13,7 @@ nameserver ``` ## Статика -```bash +```shell auto iface inet static address @@ -24,7 +24,7 @@ iface inet static ``` ## DHCP -```bash +```shell auto iface inet dhcp diff --git a/content/posts/pfx-to-pem.md b/content/posts/pfx-to-pem.md index 6d4edb8..5523548 100644 --- a/content/posts/pfx-to-pem.md +++ b/content/posts/pfx-to-pem.md @@ -6,24 +6,24 @@ tags: [linux, tls] --- ## Извлечение сертификата и ключа -```bash +```shell openssl pkcs12 -in .pfx -out .pem -nodes ``` ## Извлечение сертификата -```bash +```shell openssl pkcs12 -in .pfx -clcerts -nokeys -out .pem ``` ## Извлечение ключа -```bash +```shell openssl pkcs12 -in .pfx -nocerts -out .tmp.pem ``` ## Обеспароливание ключа -```bash +```shell openssl rsa -in .tmp.pem -out .pem ``` diff --git a/content/posts/run-nologin.md b/content/posts/run-nologin.md index 4dadcf7..162f266 100644 --- a/content/posts/run-nologin.md +++ b/content/posts/run-nologin.md @@ -8,13 +8,13 @@ tags: [linux] В найденых файлах необходимо закомментить все строки с pam_nologin.so. -```bash +```shell cd /etc/pam.d nano $(grep -Rl "pam_nologin.so") ``` ## Перезагружаем машину -```bash +```shell init 6 ``` diff --git a/content/posts/windows-disable-shutdown.md b/content/posts/windows-disable-shutdown.md index c21be5d..0bcf432 100644 --- a/content/posts/windows-disable-shutdown.md +++ b/content/posts/windows-disable-shutdown.md @@ -6,7 +6,7 @@ tags: [windows] --- ## Отключение В ветке реестра выставить значение value на 1. -``` +```sh Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\default\Start\HideShutDown Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\default\Start\HideRestart Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\default\Start\HideSleep