H
H
HoHsi2016-07-06 14:21:13
linux
HoHsi, 2016-07-06 14:21:13

How to make a function call before session initialization in Linux?

Good afternoon!
Is it possible to somehow execute a function before initializing a session in Linux via SSH?
Those. after someone logged in via SSH in the system, say by email, a notification about this came.
Is it possible to implement this in BASH, so that it would be possible to expand the script

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2016-07-06
@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
command 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".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question