ClamAV Anti-Virus and ClamTK on Ubuntu

In general, you don’t need an anti-virus software for Linux operating system such as Ubuntu. But for some reasons you might want a virus scanner on your Linux PC. One of the most popular ones is the ClamAV anti-virus. ClamAV Anti-virus is an open source antivirus software engine for detecting trojans, viruses, malware & other malicious threats.

Official project website: https://www.clamav.net/

Installing ClamAV Anti-Virus

Here is how you can install it on your Ubuntu PC:

  1. Open Terminal
  2. Enter command:
    sudo apt-get install clamav
  3. Enter your administrator password to continue installation

Using ClamAV from Terminal

By default, updating the virus definition is handled by daemon at a regular interval. But if you need to update the virus definition manually, we need to stop the daemon first and run the update command:
sudo /etc/init.d/clamav-freshclam stop
sudo freshclam
sudo /etc/init.d/clamav-freshclam start

To scan for viruses, the command syntax: clamscan OPTIONS File/Folder

If necessary, start the scan with root permissions: sudo clamscan OPTIONS File/Folder

Below is the examples you can use with ClamAV antivirus in Terminal:

  • The scan all files on your Ubuntu PC
    clamscan -r /
  • To scan all files, but only display infected files and ring a bell when found:
    clamscan -r --bell -i /
  • To scan files in the all users home directories:
    clamscan -r /home
  • To scan files in the USER home directory and move infected files to another folder:
    clamscan -r --move=/home/USER/VIRUS /home/USER
  • To scan files in the USER home directory and immediately remove infected files (WARNINGS: files are deleted permanently)
    clamscan -r --remove /home/USER
  • To see more clamscan options:
    clamscan --help

Installing ClamTK

clamtk

ClamTK is a graphical front-end for ClamAV. It is designed to be an easy-to-use, lightweight and on-demand antivirus scanner for Linux systems.

Official project website: https://dave-theunsub.github.io/clamtk/

How to install it:

  1. Open Terminal
  2. Enter command:
    sudo apt-get install clamtk
  3. Enter your administrator password to continue installation

Apache 2 Installation & Setup

How to Install Apache 2 on Ubuntu Linux

Here is the commands to run in Terminal to install Apache2 on Ubuntu Linux:

To see available service commands:

 

Install & Configure OpenSSH on Ubuntu

Install and Enable OpenSSH Server on Ubuntu Linux

Open Terminal and enter the following commands:

Stop, Start and Restart OpenSSH service, Status and Reload

Open Config File and Change SSH Server Port Number

Change port 22 to different port number.

Optionally, For improved security:

  1. Find and change PermitRootLogin from yes to no
  2. At the end of the config file, add the following lines:
    UseDNS no
    AllowUsers [username]

    After reload, only above users can connect to the SSH server
  3. Save, close and reload SSH service

How to use SSH to connect to a remote server

And enter password. To quit from the connected session:

Identify Ubuntu Version

To identify current Ubuntu installed version and somehow there are no quick way to find it on Xubuntu:

  1. Start Terminal
  2. Type the following command:
    cat /etc/issue
    or
    lsb_release -a

Change Login and Home Folder in Ubuntu Server

To change login username and home folder, first restart Ubuntu Server in recovery mode.
$ sudo poweroff/reboot

During reboot, choose recovery mode and choose root session, and then remount the file system as read-write:
$ mount -o remount,rw /

Now rename home folder, move contents and rename login and account name.
See http://manpages.ubuntu.com/manpages/trusty/man8/usermod.8.html
$ usermod -d /home/[newhomedir] -m [currenthomedir]
$ usermod -l [newlogin] [currentlogin]
$ usermod -c "New User Name" [login]

Then change group name, which also can be done outside recovery/root session:
$ groupmod -n [newgroupname] [currentgroupname]

Optionally, to reset the password:
$ passwd [username]

To see list of users:
$ cat /etc/passwd
$ less /etc/passwd
$ more /etc/passwd

Or, to list just logins:
$ awk -F':' '{ print $1}' /etc/passwd

Lastly, poweroff and reboot:
$ poweroff

Or
$ reboot