How to launch TeamViewer to act as a server only using a shell?

6

1

I have root shell access to a server, but need to use graphical applications on it. How could I launch TeamViewer (that is already installed) on the linux server, so that I could get the ID and Password of the session?

viderizer

Posted 2012-08-29T17:36:55.917

Reputation: 63

Answers

4

Found this here. I would recommend following the link, however, as the author does explain a bit more.

Basically, the script starts Teamviewer automatically at startup, takes a screenshot of the Teamviewer screen (which includes the ID and password), and attaches it to an email composed in Thunderbird.

Pretty nifty if you ask me. Hopefully it works :)

[sourcecode language="bash"]
echo ‘Loading TeamViewer…’;
teamviewer &
echo ‘waiting 20 seconds’;
sleep 20;
echo ‘Taking screenshot’;
import -window root YOURSCREENSHOTNAME.png;
echo ‘Creating email’;
thunderbird -compose “to=’YOUR@EMAILADDRESS.HERE’,subject=’TV PWD’,attachment=’~/YOURSCREENSHOTNAME.png’,body=’login now’” &
echo ‘waiting 2 seconds’;
sleep 2;
xdotool key ‘ctrl+Return’;
[/sourcecode]

JoshP

Posted 2012-08-29T17:36:55.917

Reputation: 2 236

http://flukylogs.blogspot.com/2011/08/teamviewer-unattended-auto-start-in.html#IDComment248642032 link given at the bottom of the page might work better. – Rob – 2012-08-29T19:15:31.570

@Rob I saw that as well, but requires having GUI access to get some of that set up. OP has only shell access. – JoshP – 2012-08-29T19:19:08.427

1

If you have access to a headless server, or text-only server, this may not help you. However, if you can access the desktop of your Linux machine, you may create a bash script that will execute teamviewer upon login. You will have to check how to use your Linux machine's "autologin" process. Once the autologin is done, create another bash script that has to be part of the "auto started applications".

willowdan

Posted 2012-08-29T17:36:55.917

Reputation: 51

0

As easy as running this from the remote console:

export DISPLAY=:0
teamviewer

Teamviewer keeps the same ID between program reopenings, so you don't need to grab it.
About the password, you can set it to be always the same by following the steps here: How can I set a fixed custom password in Teamviewer (server) without sending registration data?
Tested working fine on TeamViewer v9.0.24147 with Ubuntu 12.04.4 LTS and Kali v1.0.6.

P.S: it seems somebody succeeded by runing this command that make things easier:

teamviewer --passwd [YourPassword]

Not me, saddly.

Sopalajo de Arrierez

Posted 2012-08-29T17:36:55.917

Reputation: 5 328