I read that I can add a line like this to /etc/ssh/sshd_config: ForceCommand /etc/ssh/loginscript.sh
The "loginscript.sh" is executable and only does screen -ls
until now. I suppose the problem is, that it is executed in another shell instance, right? I didn't get any output on login yet.
EDIT:
OK, I solved the initial problem: Normal users had no permissions to execute the script in /etc
. I moved it to /
, now it works and echos to the login shell.
Next problem: The SSH connection closes directly after the script is executed. Any suggestions?