Lanuch Teamviewer Through SSH

Posted by hnqiu on May 1, 2019

:unlock: This post is open-sourced.

Even if we can login to the server computer remotely via ssh, sometimes it would be best to have graphical control of that machine. In this case, Teamviewer is an ideal tool.

One thing to be noted is, unlike terminal access, we can only have one screen to control. Therefore, only one user should be allowed to have graphical control at a time, otherwise everyone will be trying to take it over.

Before doing the following, we should have installed Teamviewer on both ends.

  1. ssh to the host
     ssh <user>@<ip_addr>
    
  2. Check if teamviewer is available by teamviewer help. If no such command, find out where it is using whereis teamviewer and navigate to the location.

  3. Get teamviewer id
     teamviewer info
    
  4. Reset password (if necessary)
     sudo teamviewer passwd NewPassword
    
  5. Enable and start teamviewer
     sudo teamviewer daemon enable
     sudo teamviewer daemon start
    
  6. Log out ssh and use teamviewer to connect to the remote machine

Acknowledgement

This note is based on TONI SOTO’s blog.