When I login the first time after a reboot per ssh into my pi2, I can type into the terminal. But after some logins as you can see in the image below, I can't type into the terminal.
What can cause this and how could I solve it?
Not being able to type into an ssh terminal often indicates a connectivity problem (ie. the machine you are accessing the pi from, cannot reach the pi, or the pi is hanged up or disconnected).
I recommend you connect a keyboard and a screen to the pi, and the next time this happens, troubleshoot if the pi is alive or not, and if it's connected to your network.
Depending on that, you could look for questions about the pi hanging or about connectivity issues.
Edit: perhaps you should first check /var/log/syslog user.log, error.log and any other log relevant to your setup, in case something is actually throwing a specific error.
Hope this helps!