Sysstat and SSH Keys

Installing SSH Demon

To install the SSH demon use the command:
sudo apt-get update && sudo apt-get install ssh

Remember to use good passwords on your machines if you want to connect to them using ssh.

Allowing access through firewall

To allow ssh access through firewall I used the command:
sudo ufw allow 22/tcp

Then followed up with: sudo ufw enable
This allows ssh access through port 22.

Transferring files via SSH connection

Because the assignment did not specifically require scp command to transfer files, and I had a need to transfer files from a Linux to Windows computer, I decided to use FileZilla instead, because it supports sftp, which uses ssh.


Assigning an SSH Key to a Digital Ocean Droplet


First I generated an SSH key using PuTTYgen Key Generator. I saved the public and private keys.

Then I copied the public key to Digital Ocean and created a new virtual server and ticked the checkbox so the server was installed with the key.

I then loaded the private key to Pageant and opened an SSH connection via PuTTY to my fresh server. It only asked for my username and used the SSH key for authentication.

Analyzing Sysstat data

I downloaded sysstat using command:
sudo apt-get install sysstat

I then configured the data collection to happen every 2 minutes instead of 10
to accumulate as much data as fast as possible.

Screenshot from 2018-02-27 17-07-12Screenshot from 2018-02-27 17-38-18

In the first picture you can see the data of about an hour’s worth, updated every 2 minutes. %user indicates the percentage of CPU used for user level applications. You may notice in this column a significant uptick, during which time I was browsing the internet and opening software to trigger a response in the statistics.

%system, as the name implies gives us information about the percentage of time the CPU spends on system tasks. During the uptick on %user column, there’s also an uptick on the %system column, which tells us that the system was running processes on the background during this time.

%idle is another interesting column for the purpose of this test, because mostly for the purpose of the test I was just letting my laptop collect data. You can see that during the uptick where I was actually using the computer the idle percentage is significantly lower.

In the second picture I used the command: iostat

The average cpu usage for user has been a measly 2,68% during the evaluation period. For system tasks the percentage is 0,68% and the cpu has spent 94,16% of the evaluation period idle. It’s interesting to note that the %iowait data is 2,32% meaning that the cpu has spent that amount of time idle while waiting for an operation to finish.


Linux Course by Terp Karvinen

Installing and configuring sysstat

Analyzing sar data

Understanding iostat

Using SSH Keys with Digital Ocean droplets



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s