HoHsi
@HoHsi

Как делать вызов функции перед инициализацией сессии в Linux?

Добрый день!
Можно ли как-то выполнять функцию, перед инициализацией сессии в Linux через SSH?

Т.е. после того как кто-то залогинелся через SSH в системе, скажем на email, приходило уведомление об этом.

Возможно ли это реализовать на BASH, что-бы была возможность расширять скрипт
  • Вопрос задан
  • 300 просмотров
Пригласить эксперта
Ответы на вопрос 1
BuriK666
@BuriK666
Компьютерный псих
linux.die.net/man/5/sshd_config
PermitUserRC
Specifies whether any ~/.ssh/rc file is executed. The default is “yes”.

ForceCommand
Forces the execution of the command specified by ForceCommand, ignoring any command supplied by the client and ~/.ssh/rc if present. The command is invoked by using the user's login shell with the -c option. This
applies to shell, command, or subsystem execution. It is most useful inside a Match block. The command originally supplied by the client is available in the SSH_ORIGINAL_COMMAND environment variable. Specifying a com‐
mand of “internal-sftp” will force the use of an in-process sftp server that requires no support files when used with ChrootDirectory. The default is “none”.
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы