E
E
elisey4742015-11-28 16:40:16
linux
elisey474, 2015-11-28 16:40:16

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

4 answer(s)
M
Melkij, 2015-11-28
@melkij

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.

A
Aves, 2015-11-28
@Aves

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 путь_к_программе

Or via pamsimilar to unix.stackexchange.com/questions/136548/force-comm...

A
alegzz, 2015-11-28
@alegzz

chroot

O
Oleg Tsilyurik, 2015-11-28
@Olej

$ ssh -X [email protected] my_GUI_programm
$ man ssh

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question