×


Category: Docker


Clear Apt Cache on Ubuntu 20.04 - Best Method ?

This article covers the best method of listing and cleaning the apt cache on your Ubuntu system. Ubuntu users can clean Apt archive cache using sudo apt-get clean and sudo apt-get autoclean commands. The apt-get is a APT package handling utility or the command-line tool for handling packages. These commands clears out the local repository. The autoclean command only removes packages and files that are no longer in use. Ubuntu users can also do the same task from Synaptic package manager. Open Synaptic, go to Settings > Preferences > File tab. Select to delete packages that are no longer in use.

To clean Apt archive cache folder on Ubuntu, run:

$ sudo apt-get update
$ sudo apt-get clean
$ sudo apt-get autoclean


  • clean – clean clears out the local repository of retrieved package files. It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/.
  • autoclean – Like clean, autoclean clears out the local repository of retrieved package files. The difference is that it only removes package files that can no longer be downloaded, and are largely useless. This allows a cache to be maintained over a long period without it growing out of control. The configuration option APT::Clean-Installed will prevent installed packages from being erased if it is set to off.


Add Users to Sudo Group On Linux Mint 20 - Best Method ?

This article covers how to add and remove users in the sudo group to manage the sudo privileges of the users. sudo is a command-line program that allows trusted users to execute commands as root or another user.


Use Conditional Statements in Bash Scripts

This article covers an overview of conditional statements in bash scripts. Bash expression is the combination of operators, features, or values used to form a bash conditional statement. Conditional expression could be binary or unary expression which involves numeric, string or any commands whose return status is zero when success.

Bash if conditionals can have different forms. The most basic if statement takes the following form:

if TEST-COMMAND
then
  STATEMENTS
fi


DockerSlim to Minify, Optimize, and Secure Docker Container in Linux

This article covers how to install DockerSlim in the Linux system and how it can be used to optimize and secure Docker containers. DockerSlim has an interactive shell that you can use to slim and secure your containers.

You can open DockerSlim shell by typing docker-slim on you terminal.


The basic commands for dockerslim include:

  • Build – Analyzes, profiles and optimizes your container image then generates the supported security profiles.
  • xray – Used to perform a static analysis of a container image, you can use this command if you want to see what makes the container fat.
  • lint – Used to analyse container instructions in a DockerFile.
  • profile – Used to perform an analysis of the container image without generating an optimized image.


10 Best Ways to Secure Your SSH Server

This article covers methods of hardening SSH servers that help to avoid different security risks. With the advancements in technology, many business processes we carry out today heavily relies on the internet, online tools and connected devices. That is why taking the necessary precautions to ensure the network security has utmost importance. If an organization fails to secure their network, they are open to cyber attacks which can result in data breaches, losing digital assets, losing business and even going out of business.


How to secure SSH ?

If you want to make sure that your SSH server is impenetrable and secure, you should follow the steps below:

  • Set a custom SSH port. By default, SSH is set to be listening on port 22. Unfortunately, almost all cyber attackers know that. That is why changing it to something random like Port 821 offers an additional layer of security by obscurity.
  • Employ TCP wrappers. TCP Wrappers offer a host-based ACL protection that will allow you to sort out and filter who is able to access the SSH server.
  • Disable root login. Another default setting of the SSH server is that it allows root login on Unix and Linux operating systems. Since this feature can easily be exploited by the cyber attackers, we advise you to disable it.
  • Disable empty passwords. Again, in Unix and Linux operating systems, SSH server allows the users to create empty passwords which practically mean keeping the door open for intruders. Make sure that no user opts for an empty password by disabling the option.
  • Block SSH brute force attacks. In order to do so, you can opt for manually going through the system logs, detect the intruders and block them by using the firewall. Another (and much easier) method is using tools like Fail2ban, SSHGuard and such.


Install Emacs Editor on CentOS 8 - Best Method ?

This article covers different methods to install the emacs editor on CentOS 8 system. Emacs is one of the oldest and most versatile text editors available for Linux and UNIX-based systems. It's been around for a long time (more than twenty years for GNU emacs) and is well known for its powerful and rich editing features. Emacs is also more than just a text editor; it can be customized and extended with different "modes", enabling it to be used like an Integrated Development Environment (IDE) for programming languages like Java, C or Python.


To Install Emacs via EPEL repository, Run the following command:

$ sudo dnf update
$ sudo dnf install epel-release
$ sudo dnf install emacs