openssh-logo

Most common custom SSH Configurations of the OpenSSH Server

The Openssh set of utilities let us create secure, encrypted connections between machines. In this tutorial we will take a look at some of the most useful options we can use to change the behavior of sshd, the Openssh daemon in order to make your Linux system administration job easier.

In this article we assume the existence of an already running and accessible server. If you want to know more about Openssh installation, you can take a look at this article on how to install SSH server on Ubuntu Linux.

In this tutorial you will learn:

  • How to customize the behavior of the sshd daemon by manipulating options in the main ssh config file /etc/ssh/sshd_config
  • How to change the default port(s) used by the server
  • How to change the address the server listens to
  • How to change the maximum SSH login time
  • How to allow or deny login as root
  • How to change the max login attempts and maximum number of session opened
  • How to display a message when user tries to authenticate to the server
  • How to Enable/Disable password and pubkey authentication
  • How to Enable/Disable HostBasedAuthentication
  • Enabling/Disabling X11 Forwarding

Read more

How to restrict access to a resource using Apache on Linux

How to restrict access to a resource using Apache on Linux

Restricting access to a resource is often required when using the web. On complex web applications, this is often implemented using a login system which can be more or less sophisticated. If our requirements our pretty basic, however, we can use the authentication system provided by the Apache web server. In this tutorial we will see how can we do it.

In this tutorial you will learn:

  • How to restrict access to a web page using the Apache web server
  • How to store the user passwords in plain text files
  • How to store the user passwords in a database
  • How to allow access to multiple users

Read more

How to enable all SysRq functions on Linux

Objective

Learn how to enable the SysRq functions, and how to use invoke them by using command keys.

Requirements

  • Root permissions
  • Linux Kernel compiled with the “CONFIG_MAGIC_SYSRQ” option enabled

Conventions

  • # – requires given linux commands to be executed with root privileges either
    directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Introduction

The SysRq key combination can be used to send commands directly to the Linux kernel in some specific circumstances: the kernel will respond to commands sent with command keys immediately, unless it is completely locked. Various command keys achieve specific tasks, and they can be combined to restore the system to a safe state, or to obtain a clean reboot when nothing else works: this is what we can obtain with the reisub sequence.

In this tutorial we will see how to enable all SysRq functions using a standard installation of Ubuntu 18.04 - Bionic Beaver as a base.

Read more

Sysbench CPU Benchmark

How to Benchmark Your Linux System

Objective

Use GeekBench, Sysbench, Hardinfo, and Phoronix Test Suite to benchmark your Linux system.

Distributions

This will work on most modern distributions.

Requirements

A working Linux install with root privileges.

Conventions

  • # – requires given linux command to be executed with root privileges either directly as a root user or by use of sudo command
  • $ – given linux command to be executed as a regular non-privileged user

Introduction

There are a bunch of reasons that you’d want to benchmark your Linux system. Most people benchmark out of pure curiosity or to measure the system’s performance for games. Benchmarking can also help you identify problems with your system, though, and improve weak points for a smoother and more efficient experience. Benchmarking also helps you identify possible software issues and problematic upgrades with regressions.

There are a number of great ways to benchmark your Linux system. This guide will cover a few of the most common ones. Using any number of these will give you a good perspective of what your system can do, and where its possible weak points are.

Read more

systemd-logo

How to schedule tasks with systemd timers in Linux

The traditional way to schedule tasks on Linux, is to use the cron daemon, specifying time intervals and
commands to be executed in crontabs.

Systemd, the relatively new init system now adopted by all the major Linux distributions, among the other things, provides the ability to schedule tasks using dedicated units, called timers. In this article we will learn how they are structured and some examples of their usage.

In this tutorial you will learn:

  • The basic structure of systemd timers;
  • How to create monotonic and realtime timers;
  • How to list and inspect active timers;
  • How to enable timers;
  • How to use transient timers;

Read more

Deluge Disable Classic Mode

Set Up A Headless Deluge Server on Linux

Objective

Install and configure a headless Deluge server, and connect to it with the Deluge client.

Distributions

This guide is tailored towards Debian, Ubuntu, Fedora, OpenSUSE, and Arch Linux.

Requirements

A working install of one of the supported distributions with root privileges.

Conventions

  • # – requires given linux command to be executed with root privileges either directly as a root user or by use of sudo command
  • $ – given linux command to be executed as a regular non-privileged user

Introduction

There are tons of ways to manage torrents on Linux. Many of the available clients are excellent, but some have distinct advantages. If you’re looking to manage large numbers of torrents and manage them over your network, Deluge is easily the best option.

Deluge relies on a client-server model. The Deluge daemon runs on a designated server machine that handles the download and upload of files. Then, you can connect to your server using the Deluge client on any computer on the same network to add, remove, and manage your torrents.

It doesn’t hurt that it’s very simple to control your torrents with Deluge either. It lets you easily add torrents from a variety of sources and even control their priority and place in the download queue.

Read more

docker-logo

How to build a docker image using a Dockerfile

Docker skills are high in demand mainly because, thanks to the Docker we can automate the deployment of applications inside so-called containers, creating tailored environments that can be easily replicated anywhere the Docker technology is supported. In this tutorial we will see how to create a Docker image from scratch, using a Dockerfile. We will learn the most important instructions we can use to customize our image, how to build the image, and how to run containers based on it.

In this tutorial you will learn:

  • How to create a docker image using a Dockerfile
  • Some of the most frequently used Dockerfile instructions
  • How to achieve data persistence in containers

Read more

Curl command on Linux

Curl file download on Linux

The cURL linux command can use various network protocols to download and upload data on Linux. Normally, using the cURL command is pretty basic, but it has a ton of options and can grow more complicated very quickly. In this guide, we’ll go over some of the more common uses for the cURL command and show you syntax examples so you can use it on your own system.

In this tutorial you will learn:

  • What is cURL and what can it do?
  • How cURL compares to wget
  • How to download a file from a website with cURL
  • How to follow redirects
  • How to download and untar a file automatically
  • How to authenticate with cURL
  • How to download headers with cURL
  • How to use quiet mode with cURL

Read more

test Internet connection on Linux

How to test Internet connection on Linux

In this tutorial you will learn how to test internet connection on Linux operating system. When we talk about the internet connection usually this for everybody means different thing. Meaning, you might be connected to the Internet but unable to browse any web sites.

In this tutorial you will learn:

  • How to test internet connection
  • How to test DNS resolution
  • How to test Local Area network
  • How to check your DNS resolution

Read more

Secure your SSH with passwordless connection

Introduction

SSH is in essential tool for any Linux user, but many people aren’t making the most of its robust capabilities, namely secure logins with keys.

SSH key pairs allow you to login much more securely by limiting logins to only those computers that possess an encrypted key that has been paired with the login target. Unlike passwords, these keys can’t be guessed, so there’s no need to worry about someone trying thousands of passwords to break into your computer or server. No key equals no access.

The good news is; these keys are very easy to set up and use, so you don’t have to worry about maintaining configurations or wading through a long setup process.

Read more