0

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.

Kladskull
  • 1,255
  • 5
  • 15
  • 32

2 Answers2

2

You can set your program as shell in /etc/passwd

sborsky
  • 315
  • 1
  • 6
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