If you need a commandline configuration of Teamviewer (eg. you are connected through SSH) do this.
Display the commandlist
Start Teamviewer with
teamviewer --daemon start
Set a password (without special characters like !?/$...)
teamviewer --passwd PASSWORD
Display the status and ID
Now you can connect to your system with the graphical interface.
If you want to close Teamviewer use
teamviewer --daemon stop