Remotely Add Linux Host To TeamViewer Account

Working remotely has become a standard these days, and accessing our computers remotely has become a necessity. In the life of a developer, this necessity is even greater if you add to your list a secondary computer, the office computer, a home lab, test machines, virtual machines, and so on. Although the terminal is enough to do a remote job, there are situations when you need to actually see the screen and run some desktop applications on it. In the following sections, I will detail how to install and configure Team Viewer on Linux remotely so you can access it easily using the application. Team Viewer is one of the most popular remote access and control applications, and the best thing about it is that it is cross-platform!

Prerequisites

  • sudo credentials to access the remote machine
  • a Team Viewer account
  • a terminal

For this article, I’ll be using two hosts, one running Ubuntu 20.04LTS and one running Fedora 34. The machines will be accessible via SSH.

Ubuntu

Step 1: Connect to your host

Open a terminal and connect to your host using SSH.

The host must have an SSH Server running for this to work as it is not installed by default.

ssh username@host

Step 2: Install TeamViewer

Install Team Viewer using the latest official package.

cd /tmp
wget https://download.teamviewer.com/download/linux/teamviewer_amd64.deb
sudo apt install ./teamviewer_amd64.deb -y
sudo teamviewer daemon start
# Make teamviewer start when the system turns on
sudo teamviewer daemon enable

Step 3: Set up TeamViewer

Next, we are going to use the TeamViewer CLI to connect the host to the official account.

sudo teamviewer setup

You’ll be asked to accept the License Agreement and then to input your username and password. The first login will fail as TeamViewer requires the user to trust devices before adding them to the account list.

Step 4: Trust the device

At this point, you will have to open your email and trust the device.

Once you’ve added the device to the trusted list, type the username and password into the terminal. Select yes when asked if you want to add the host to your computers group. And that’s it!

Now, if you log in to the TeamViewer app, you’ll see the newly added host.

Other Commands

# Stop Teamviewer
sudo teamviewer daemon stop

# TeamViewer won't start automatically when the system turns on
sudo teamviewer daemon disable

# Uninstall TeamViewer
sudo apt purge teamviewer -y

Fedora

Step 1: Connect to your host

Open a terminal and connect to your host using SSH.

The host must have an SSH Server running for this to work as it is not installed by default.

ssh username@host

Step 2: Install TeamViewer

Install Team Viewer using the latest official package.

cd /tmp
wget https://download.teamviewer.com/download/linux/teamviewer.x86_64.rpm
sudo dnf -y install teamviewer.x86_64.rpm
sudo teamviewer daemon start
# Make teamviewer start when the system turns on
sudo teamviewer daemon enable

Step 3: Set up TeamViewer

Next, we are going to use the TeamViewer CLI to connect the host to the official account.

sudo teamviewer setup

You’ll be asked to accept the License Agreement and then to input your username and password. The first login will fail as TeamViewer requires the user to trust devices before adding them to the account list.

Step 4: Trust the device

At this point, you will have to open your email and trust the device.

Once you’ve added the device to the trusted list, type the username and password into the terminal. Select yes when asked if you want to add the host to your computers group. And that’s it!

Now, if you log in to the TeamViewer app, you’ll see the newly added host.

Other Commands

# Stop Teamviewer
sudo teamviewer daemon stop

# TeamViewer won't start automatically when the system turns on
sudo teamviewer daemon disable

# Uninstall TeamViewer
sudo dnf remove teamviewer -y

Summary

Installing TeamViewer using the terminal is pretty straightforward, and the CLI is straightforward to use. The TeamViewer team provides some more options that can be inspected using man teamviewer or teamviewer --help for a shorter version.

In a World of Power, Stay Humble

The longing for and pursuit of power is nothing new. We live in a time where a business tycoon became president, police are abusing their power, and corporate greed is still an everyday norm. But, something about all of this is different this time around. We’re not standing for it. We’re seeing ego, greed, corruption and we’re calling it out. It’s important to stay humble and think twice before you speak – especially if you’re in a leadership position.

The Stanford Prison Experiment

In 1973 this experiment went underway to determine if brutality inflicted on prisoners by guards was due to hostile personalities, or due to the power associated with their role. The experiment found that “prisoners and guards may behave in a hostile manner due to the rigid power structure of the social environment in prisons. Zimbardo predicted the situation made people act the way they do rather than their disposition” (1). Participants were paid $15 a day to be a part of this experiment. They were “randomly assigned to either the role of a prisoner or guard in a simulated prison environment.”

The study goes on to cite, “Within hours of beginning the experiment some guards began to harass prisoners. At 2:30 A.M. prisoners were awakened from sleep by blasting whistles for the first of many “counts.” The counts served as a way to familiarizing the prisoners with their numbers. More importantly, they provided a regular occasion for the guards to exercise control over the prisoners.”

Intoxication of Power

According to this psychology article, power itself can be intoxicating and that is what pushes those in a leadership position to edge towards corruption. It is suggested that those who engage “in wrong behavior simply because they can and they can get away with it” (2). The saying “drunk with power” is a prime example of this. In a way, it’s people testing the new and more expanded boundaries of their reality, no matter the cost.

Be Humble, Sit Down

If you are in a position of power, especially if this experience is new for you, you may be wondering how you can keep your morals and not let your position of authority go to your head. Humility in leaders is rare and it’s what makes the good ones last. It takes more strength and courage to lead with humility than it does to abuse your power. Humility is a sought-after trait for top-performing leaders.

In Jim Collins’s book Good to Great, Collins “found two common traits of CEOs in companies that transitioned from average to superior market performance: humility and an indomitable will to advance the cause of the organization” (3). Additionally, a survey that included 105 software and hardware firms as participants was published in the Journal of Management and stated that “humility in CEOs led to higher-performing leadership teams, increased collaboration and cooperation and flexibility in developing strategies” (4).

In order to be humble, you must know how to admit fault and take accountability. Leadership and power tends to be observed more through the execution of actions. Do you give others credit where due? Do you take responsibility and accountability? How do you act when you receive credit, praise, a raise or promotion? How does your team see you? In an organization like Netflix, open feedback is encouraged and even required once a year. This process allows managers to review one another and their employees, and one step further, allows employees to review their managers as well. Employees are even welcome to cite feedback of the CEO and other leadership positions, all in an effort to keep everyone communicative, honest, and humble.

So, the next time you find yourself in a position of power and have even the slightest temptation to see how far you can go with that power, take a minute to pause. Think before you speak. Check-in with yourself and your morales before making decisions. In the words of Kendrick Lamar, “be humble, sit down.”