Revert "remove shell"

This reverts commit 65914f8895.
This commit is contained in:
root
2023-09-24 18:58:33 +03:00
parent 65914f8895
commit c793b55750
26 changed files with 132 additions and 132 deletions

View File

@ -5,19 +5,19 @@ date: 2022-11-29T13:35:00+05:00
tags: [linux, ssh]
---
## Установка пакета
```
```shell
apt install -y openssh-server libpam-google-authenticator
```
## Правка конфига PAM
```
```shell
auth required pam_google_authenticator.so
# auth required pam_google_authenticator.so
```
## Правка конфига ssh
```
```shell
ChallengeResponseAuthentication yes
# /etc/ssh/sshd_config
@ -27,26 +27,26 @@ ChallengeResponseAuthentication yes
Следующая команда сконфигурирует TOTP.
Запускать команду следует от имени того пользователя,
к которому будет инициализированно подключение.
```
```shell
google-authenticator
```
## Управление факторами (необязательно)
Включить запрос ключа при аутентификации:
```
```shell
AuthenticationMethods publickey,password publickey,keyboard-interactive
# /etc/ssh/sshd_config
```
Отключить запрос пароля при аутентификации:
```
```shell
#@include common-auth
# /etc/pam.d/sshd
```
## Перезапуск сервиса ssh
```
```shell
systemctl restart ssh
```