由于要通过要远程登录到内网的电脑(一台笔记本),用于在紧急情况下处理服务器故障。刚开始准备使用ssh端口转发,无奈vps转发速度太慢。
后面考虑使用TeamViewer远程控制Windows桌面,但是操作太过卡顿。
今天心血来潮,网上搜了一下Linux命令行下安装TeamViewer,没想到还真的有。官网就有相应的教程,How to install TeamViewer on Linux without graphical user interface
因为所用的Linux版本为CentOS 7,以下记录下操作的过程。
安装和远程登录
- 下载安装包
[root@centos7 ~]# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
[root@centos7 ~]# wget https://download.teamviewer.com/download/linux/teamviewer-host.x86_64.rpm
- 安装yum源
[root@centos7 ~]# yum install ./epel-release-latest-7.noarch.rpm
- 安装TeamViewer (过程需要安装以来包,选择y即可)
yum install ./teamviewer-host*.rpm
- 进入默认安装目录
cd /opt/teamviewer/tv_bin/
- 查看运行状态,获取连接ID
[root@centos7 tv_bin]# teamviewer --info
TeamViewer 13.2.13582 (RPM)
TeamViewer ID: 5441813009
teamviewerd status ● teamviewerd.service - TeamViewer remote control daemon
Loaded: loaded (/etc/systemd/system/teamviewerd.service; enabled; vendor preset: disabled)
Active: active (running) since 六 2018-09-01 04:38:39 CST; 3min 33s ago
Main PID: 2879 (teamviewerd)
CGroup: /system.slice/teamviewerd.service
└─2879 /opt/teamviewer/tv_bin/teamviewerd -d
9月 01 04:38:39 centos7 systemd[1]: Starting TeamViewer remote control daemon...
9月 01 04:38:39 centos7 systemd[1]: PID file /var/run/teamviewerd.pid not readable (yet?) after start.
9月 01 04:38:39 centos7 systemd[1]: Started TeamViewer remote control daemon.
- 设置连接密码
[root@centos7 tv_bin]# teamviewer --passwd 123456
ok
- 然后可以直接使用在客户端使用连接ID和密码进行登录