Answer the question
In order to leave comments, you need to log in
How to make a program autostart when a user logs in via SSH without the possibility of closing it?
The system is like this. The user comes on ssh and my program is started at once. In addition, the user should not be able to get out of it and get into the shell either. How to do it?
Answer the question
In order to leave comments, you need to log in
Put this program of yours instead of a shell for the right users.
usermod -s /path/to/shell YOUR_USERNAME
The application may need to be modified a little - I did not have to write a shell replacement, I do not know if the application should implement any specific interfaces and behavior.
I don’t think that the option of replacing the shell will work well, most likely, with the program as it, it simply won’t be possible to log in.
Can be added to sshd_config
Match User имя
PermitTTY no
ForceCommand путь_к_программе
pam
similar to unix.stackexchange.com/questions/136548/force-comm...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question