mirror of
https://github.com/fruworg/fruworg.github.io.git
synced 2025-06-26 04:53:59 +03:00
remove shell
This commit is contained in:
@ -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
|
||||
```
|
||||
|
Reference in New Issue
Block a user