Looking to start a python program when a user connects to my SSH server. An example use case would be a MUD program (except using SSH and not Telnet). If they somehow exit the program or it errors out, I'd like them to be disconnected from the server.
Asked
Active
Viewed 173 times
2 Answers
2
You can set your program as shell in /etc/passwd

sborsky
- 315
- 1
- 6
-
To get it fully working, I added my command to /etc/shells (full path) – Kladskull Oct 19 '17 at 21:20
0
Use exec
in your shell init script to replace the current process with the program you want to run. When that exits the user is logged out and the connection is dropped.

user9517
- 115,471
- 20
- 215
- 297