Launching Teamviewer remotely through SSH


When you need to manage your Server remotely, but you can not sure that you will always be able to see the graphical, especially when the server system failure, you may have to restart your server.And then, how to launch Teamviewer remotely through command line? Maybe you can try SSH, now follow me please.

Teamviewer is a wonderful tool to access your computer (or any other device) remotely if you need to use your a graphical screen. Probably is not as secure as other linux solutions (as VNC or a VPN) but the main advantage is that is very easy to install and configure.

Suppose that we are on holidays far from home and we need to accomplish a task on our home computer using the graphical desktop. We have in our hands another device (for example a nexus7 tablet) and we are connected to WiFi hotspot. There is Teamviewer Apps for Android and IOS. We need Teamviewer installed in both machines: Desktop at home and our tablet, So I’m going to explain how can you launch remotely Teamviewer in your remote computer at home just for the time you need it to perform a particular task. As soon as we finished our job, we will stop it again to be safer.

I assume that you’ve already installed Teamviewer in your linux box and you also have a ssh account to login into your remote linux machine at home (user@home_machine:~$).

Steps:

  1. Login into your home linux box through ssh. Don’t use root access unless it was necessary. Use ‘sudo’ instead.
  2. Locate where teamviewer is installed:
    user@home_machine:~$ whereis teamviewer
    teamviewer: /usr/bin/teamviewer /etc/teamviewer
  3. Now run this command to get the list of commands:
    user@home_machine:~$ /usr/bin/teamviewer –help
    TeamViewer 8.0.17147 <-- Your version
    teamviewer start TeamViewer user interface (if not running)teamviewer --help print this help screen
      teamviewer --version print version information
      teamviewer --info print version, status, id
      teamviewer --passwd [PASSWD] set a password (useful when installing remote (ssh)
      teamviewer --ziplog create a zip containing all teamviewer logs (useful when contacting support)teamviewer --daemon status show current status of the TeamViewer daemon
      teamviewer --daemon start start TeamViewer daemon
      teamviewer --daemon stop stop TeamViewer daemon
      teamviewer --daemon restart stop/start TeamViewer daemon
      teamviewer --daemon disable disable TeamViewer daemon - don't start daemon on system startup
      teamviewer --daemon enable enable TeamViewer daemon - start daemon on system startup (default)
  4. Now we will check ID number for calling remotely our device and the currentstatus of teamviewer daemon in our computer:
    user@home_machine:~$ /usr/bin/teamviewer –info
    TeamViewer 8.0.17147
     teamviewerd status
    teamviewerd stop/waiting
    TeamViewer ID: 9XXXXXXX7 <-- Your ID number
    
  5. If we don’t remember the password to connect to teamviewer in our home machine we can reset it using this command:
    user@home_machine:~$ /usr/bin/teamviewer –passwd MYnewpassword
  6. Now it’s time to enable the teamviewer daemon and launch (start) it. check that it’s up and running:
    user@home_machine:~$ sudo teamviewer --daemon enable
    mar jul 9 13:29:00 CEST 2013
      Action: Installing daemon (8.0.17147) for 'SystemV' ...
      installing /etc/init.d/teamviewerd (/opt/teamviewer8/tv_bin/script/teamviewerd.sysv)
      System start/stop links for /etc/init.d/teamviewerd already exist.
      /etc/init.d/teamviewerd start
      Starting teamviewerd...

    user@home_machine:~$ sudo teamviewer –daemon start

    /etc/init.d/teamviewerd start
      Starting teamviewerd...
  7. We check again the status:
    user@home_machine:~$ sudo teamviewer –info
    TeamViewer 8.0.17147teamviewerd status /opt/teamviewer8/tv_bin/teamviewerd
      teamviewerd start/running
      TeamViewer ID: 9XXXXXXX7
  8. … and now we check that new connections are opened to teamviewers servers:
    user@home_machine:~$  sudo netstat -ntap | grep teamviewer
    tcp 0 0 127.0.0.1:5941 0.0.0.0:* LISTEN 20351/teamviewerd
     tcp 0 0 192.168.1.100:49333 176.223.198.114:5938 ESTABLISHED 20351/teamviewerd
  9. Now close your ssh session to your home computer otherwise you won’t be able to connect to teamviewer remotely. Once closed the ssh session try to connect to your home PC remotely using any other device you had in your hands.
  10. Once you finish close the teamviewer session and reconnect to your home computer again with ssh. We will stop teamviewer until the next time we needed it again. Commands to perform this final step is:
    user@home_machine:~$ sudo teamviewer –daemon stop

4 comentarios


  1. Edmondo Minisci

    Fantastic and very helpfull post. I’ve been trying to do something like this since many months without success. Now I can easily access the machine at my conveninence without leaving TV always on. THANKS!
    ps: I confirm it worked for me (remote machine with TV8 on Debian 7)


  2. JesterEE

    Great write-up! On my Ubuntu 13.04 installation I am able to control the daemon via SSH (start/stop/restart/etc.), but still can’t connect to the session. I looked at the differences of what is running when I start the teamviewer daemon from SSH and what get’s initialized when I login. It seems that starting the daemon does not start the “wineserver” that is started as a user process when I login. I believe your instructions assume that that is already started. I will experiment with this and see if this can be started from the system init (instead of a user login process) and restarted remotely from SSH.


    • tonisoto

      Yes, you’re right. I assumed that winserver (/opt/teamviewer8/tv_bin/wine/bin/wineserver) had already been launched when you logged in. But I can kill it and launch it again when it was needed from the console to restarting the whole service

      If I’m not wrong, we need two processes to run teamviewer at our home machine, one owned by ‘user’ and the other by ‘root’:

      user 608 0.1 0.0 4556 1764 ? Ss 13:10 0:00 /opt/teamviewer8/tv_bin/wine/bin/wineserver
      root 1075 0.6 0.1 70380 5504 ? Sl 13:17 0:00 /opt/teamviewer8/tv_bin/teamviewerd -d

      If you can try what I’m saying, kill both processes from console to start from scratch.

      To launch the wineserver as user, ssh to your machine as user and type:
      user@home_machine:~$ /usr/bin/teamviewer –info &
      Click return to go ahead.

      … then, to launch teamviewer daemon as root (sudo) type:
      user@home_machine:~$ sudo teamviewer –daemon start &
      Click return to go ahead.

      Check that both processes were created typing:
      user@home_machine:~$ ps -aux | grep view

      … you should see now two processes:
      user 2134 0.1 0.0 4448 1648 ? Ss 13:32 0:00 /opt/teamviewer8/tv_bin/wine/bin/wineserver
      root 2175 0.4 0.0 45280 3984 ? Sl 13:32 0:00 /opt/teamviewer8/tv_bin/teamviewerd -d

      Close your SSH session and try to connect to your home_machine with teamviewer.

      It works for me.


  3. Tarique

    I was able to run the teamviewer7 typing these two command

    /usr/bin/teamviewer -info &

    sudo teamviewer -daemon start &

    Now,

    ps -ef| grep view

    xxx 15582 14511 0 Feb21 pts/4 00:00:00 /bin/bash /usr/bin/teamviewer -info
    xxx 15586 15582 0 Feb21 pts/4 00:00:00 /bin/bash /opt/teamviewer/teamviewer/7/bin/wrapper wine c:\Program Files\TeamViewer\Version7\TeamViewer.exe -info
    xxx 15615 1 1 Feb21 ? 00:00:00 /opt/teamviewer/teamviewer/7/wine/bin/wineserver

    And now the big question is how will I find my ID and Passwd to connect to that remote machine through teamviewer from my home?

    Thanks

Launching Teamviewer remotely through SSH的更多相关文章

  1. Hide SSH Welcome Banner/Message on Ubuntu14.04+

    Introduction Usually when you logged in you linux based PC remotely via SSH, a long banner will be d ...

  2. linux centos 7上运行teamviewer与找不到ID问题处理办法

    以前在raspberryPi上搞过teamviewer,现在用了CentOS服务器,搞了一个vpn,访问还有点问题,时间紧张,就先给teamviewer. 而centos7 上安装也比较简单,几条命令 ...

  3. [SSH] Intro to SSH command

    Create an ssh key: ssh-keygen Copy an SSH key to a remoate server: ssh-copy-id root@104.197.227.8 // ...

  4. Python Fabric ssh 配置解读

    Python Fabric ssh 配置解读 Fabric 2.4简介: Fabric is a high level Python (2.7, 3.4+) library designed to e ...

  5. manjaro安装teamviewer实现远程连接

    不要安装库里面的这两个版本,安装后桌面快捷方式和命令行运行都正常显示窗口,但没有teamviewer ID和随机密码 12.x版本也不用下载尝试了 ➜ ~ teamviewer Init...Chec ...

  6. manjaro安装teamviewer后无法打开

    点桌面快捷方式一闪而过 命令行运行提示 $ teamviewer /opt/teamviewer/tv_bin/script/tvw_exec:行7: /opt/teamviewer/logfiles ...

  7. jenkins插件Publish Over SSH因安全问题下架

    最近用docker新搭建了一个jenkins,安装插件的时候发现publish over ssh找不到了,官方给出的解释是存在安全隐患于2022.01.12暂停分发,官方解释如下:https://ww ...

  8. rosrun和roslaunch

    rosrun allows you to run an executable(可执行) in an arbitrary(任意) package without having to cd (or ros ...

  9. CentOS7下Firewall防火墙配置用法详解

    官方文档地址: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide ...

  10. IOS Application Security Testing Cheat Sheet

    IOS Application Security Testing Cheat Sheet    [hide]  1 DRAFT CHEAT SHEET - WORK IN PROGRESS 2 Int ...

随机推荐

  1. Java 类中属性的使用

    1 类中属性的使用: 2 * 属性(成员变量) 局部变量 3 * 1.相同点: 4 * 定义变量的个格式: 数据类型 变量名 = 变量值 5 * 先声明 后使用 6 * 变量都有其对应的作用域 7 * ...

  2. C1. Good Subarrays (Easy Version)

    思路:我们枚举每一个左端点,对于每一个左端点,寻找最长的满足条件的区间,这个区间长度就是左端点对答案的贡献,可以发现具有单调性,右端点只会前进不会倒退.所以我们两个指针各扫一遍区间就可以. #incl ...

  3. TLS原理与实践(四)国密TLS

    主页 个人微信公众号:密码应用技术实战 个人博客园首页:https://www.cnblogs.com/informatics/ 引言 TLS作为保证网络通信安全的关键技术和基石被广泛应用,但目前主流 ...

  4. InputRegZen.vue 正则Input 限制输入框输入内容

    核心内容 已经 perfect,没有用外库,原生完成 用的 iview的Input组件 封装 // InputRegZen.vue <template> <div> <I ...

  5. ble无线智能工牌解决方案技术解析

    场景需求  在无线智能工牌领域,团队做了几个实际场景的解决方案之后,积累了一些行业需求经验和技术经验.这里做一个总结,算是一种沉淀吧.场景一:居家养老,医护和护工人员定期上门服务,根据工作时长来发工资 ...

  6. ESP8266 SPI 开发之软件驱动代码分析

    一 基本概述 esp8266的SPI代码流程非常的清晰,主要有三部分构成: spi_init 配置 spi_trans 配置 data_transfer 配置这三块组成. 在这里,笔者就针对spi的这 ...

  7. 记录--try...catch知识补全

    这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 说到try...catch都觉得非常熟悉了,不就是用来捕捉代码块中的错误嘛,平时也用得比较多的.然而因为了解不够多,我的面试却栽在了一个简 ...

  8. Matlab绘图(1)通过属性检查器调整绘图

    Matlab图形属性检查器 和其他语言的绘图不一样的是,Matlab允许我们通过非编程的方式来自定义调整绘图.下面介绍Matlab图形的构成以及几种调整绘图时的常用操作. 图形构成 什么是Figure ...

  9. drools执行指定的规则

    目录 1.背景 2.方案 2.1 通过AgendaFilter来实现 2.2 通过entry-point来实现 3.实现 3.1 需求 3.2 drl 文件编写 3.3 部分java代码 3.4 运行 ...

  10. 在 .NET 中使用 OPC UA 协议

    目录 什么是 OPC UA UaExpert 的使用 下载 UaExpert 首次启动 添加 OPC UA 服务器 连接 OPC UA 服务器 查看 PLC 数据 使用 C# 读写 OPC UA 数据 ...