Debian – Linux Hint https://linuxhint.com Exploring and Master Linux Ecosystem Fri, 12 Mar 2021 15:08:04 +0000 en-US hourly 1 https://wordpress.org/?v=5.6.2 How to create and run a Perl script in Debian 10 https://linuxhint.com/how-to-create-and-run-a-perl-script-in-debian-10/ Fri, 12 Mar 2021 12:37:04 +0000 https://linuxhint.com/?p=94129

Introduction:

Perl scripts are yet another powerful method of executing complex programs with a very minimal effort. The people who have a good know-how of programming in C and C++ get along with Perl very nicely because of its close resemblance to these languages. In this article, we will teach you the method of creating your first Perl script and running it in Debian 10.

Method of Creating a Perl Script in Debian 10:

For creating a simple Perl script in Debian 10, there are three main steps that you need to follow:

Step # 1: Checking the Perl Version:

You should assure that you have Perl installed on your Debian 10 system. You can do this simply by checking the version of Perl by executing the following command in your terminal:

perl --version

If Perl has already been installed on your system, then running the above-mentioned command will render the version of Perl installed on your Debian 10 system as shown in the image below:

Step # 2: Ensuring the Presence of Perl Interpreter:

Since every scripting language requires an interpreter which can help in the execution of the programs created in that language, therefore, you also need to ensure that the Perl interpreter has been installed on your system or not. You can check this out by running the following command in your terminal:

which perl

Running this command will show you the path to the binary of Perl as shown in the image below:

However, if you also want to check the path of the source file and the man pages of Perl along with the binary file for an added assurance, then you can run the following command in your terminal:

whereis perl

The output of the “whereis” command is shown in the image below:

Step # 3: Creating a Perl Script in Debian 10:

Once you have ensured the presence of Perl and its respective interpreter on your Debian 10 system, there comes the turn of creating a Perl script. A Perl script can conveniently be created by executing the following command in your terminal:

sudo nano MyFirstPerlScript.pl

Any other text editor can also be used to serve the same purpose instead of the nano editor, however, we have used this editor solely because it is the default text editor of the Linux systems. Moreover, you can have any name for your Perl script that must be followed by a .pl extension.

When you will run this command, an empty Perl script file will open with the nano editor. You just have to type the following script in your file. The first line of this script is “#!/bin/perl” which is there to explicitly state that the following script is a Perl script. Then we have simply printed a dummy message by making use of the “print” command. After typing in this Perl script in your file, you should save it and exit from the editor by pressing Ctrl+ X.

Methods of Running a Perl Script in Debian 10:

You can run a Perl script by using either of the two methods listed below:

Method # 1: Using the “chmod” Command to Set Execute Permissions:

For this method, you first have to set the execute permissions for your Perl script after which you can finally run it. The details of both these steps are listed below:

Step # 1: Setting the Execute Permissions:

You have to make the Perl script that you have just created, executable by running the following command in your terminal:

sudo chmod +x MyFirstPearlScript.pl

Step # 2: Running the Perl Script:

After making your Perl script executable, you can run it by executing the following command in your terminal:

./MyFirstPerlScript.pl

Running this script will show you its output on the terminal as shown in the image below:

Method # 2: Using the “perl” Command:

This method is an easier workaround for running a Perl script in Debian 10. It is so because it does not require you to set up any execute permissions rather you can simply run your Perl script straightaway.

You can run your Perl script by executing the following command in your terminal:

perl MyFirstPerlScript.pl

Running this script will show you its output on the terminal as shown in the image below:

Conclusion:

By following the procedures of creating and running a Perl script described in this article, you can make your life a lot easier by automating your commonly occurring tasks with the help of Perl scripting. This article just teaches you the basic method of creating and running a simple Perl script. Once you manage to learn this, you can use Perl scripting for lots of other programmatically complex problems.

]]>
How do I Access a Remote Desktop from Debian 10? https://linuxhint.com/access-remote-desktop-debian-10/ Tue, 09 Mar 2021 02:17:35 +0000 https://linuxhint.com/?p=93097 By accessing a remote desktop, we essentially mean that we want to access the desktop environment that is running on another computer system from our computer system. This strategy is generally used to provide technical support to customers by remotely accessing their computer systems. There can be several other use cases of adopting this strategy. In today’s article, we will learn how to access a remote desktop from a Debian 10 system.

Method of Accessing a Remote Desktop from Debian 10:

For accessing a remote desktop from your Debian 10 system, you will have to perform the following steps:

Step # 1: Update your Debian 10 System:

First, we have to update our Debian 10 system with the command shown below:

$ sudo apt-get update

When our Debian 10 system is fully updated, we will install a remote desktop client of our choice on it.

Step # 2: Install Remmina Remote Desktop Client on your Debian 10 System:

We need to install Remmina remote desktop client on our Debian 10 system. This can be installed with the following command:

$ sudo apt install remmina remmina-plugin-vnc

During the installation of this remote desktop client, you need to confirm by typing “Y” in your terminal, as highlighted in the image shown below:

It will take a few minutes for the installation of Remmina to complete on your Debian 10 system.

Step # 3: Launch Remmina Remote Desktop Client from your Debian 10 System:

Now, you can easily launch Remmina remote desktop client on your Debian 10 system by searching for it in the Activities search bar. You need to click on the Remmina search result as highlighted in the following image:

The welcome interface of the Remmina remote desktop client is shown in the image below:

Step # 4: Select the Virtual Network Computing (VNC) Protocol from the List of Protocols on your Debian 10 System:

For connecting to a remote desktop through Remmina remote desktop client, you need to select the Virtual Network Computing (VNC) protocol from the list of protocols on the Remmina interface as highlighted in the following image:

Step # 5: Type in the IP Address of the Remote Desktop to which you want to Connect through your Debian 10 System:

After selecting the VNC protocol, you need to type in the remote machine’s IP address whose desktop you want to access via Remmina in the provided address bar, e.g., 192.168.10.15.

You need to press the Enter key after typing in the desired IP address so that Remmina can allow you to access the specified remote desktop from your Debian 10 system, as shown in the image below:

Method of Removing the Remote Desktop Client from Debian 10:

For removing Remmina remote desktop client from your Debian 10 system, you need first to run the following command in your Debian 10 terminal:

$ sudo apt-get purge remmina remmina-plugin-vnc

This command will remove Remmina remote desktop client and its configuration files from your Debian 10 system. After doing this, you need to execute the command shown below for removing all the unused packages and dependencies as well from your Debian 10 system:

$ sudo apt-get autoremove

Conclusion:

In this tutorial, we taught you the method of installing a remote desktop client, i.e., Remmina, on a Debian 10 system and then using it for connecting to a remote desktop. This article concluded with the removal method of this remote desktop client from a Debian 10 system.

]]>
Debian List all Running Services https://linuxhint.com/list-all-running-services-debian/ Sun, 07 Mar 2021 15:34:42 +0000 https://linuxhint.com/?p=93137 Service in any operating system is defined as a background application that keeps waiting for clients’ requests. Once it receives those requests, it performs the necessary actions so that the request can be served accordingly. Service always has a status associated with it, such as active, enabled, running, inactive, dead, etc. A system administrator is mainly concerned with the services that are currently running on an operating system. In today’s article, we will explore the different methods of listing all the running services in Debian 10.

Methods of listing all Running Services in Debian 10:

For listing all the running services in Debian 10, you can select any of the following three methods:

Method # 1: Using the “systemctl” command with the “list-units” Parameter in Debian 10:

You can use the “systemctl” command with the “list-units” parameter to list down all the running services in Debian 10 in the manner shown below:

$ systemctl list-units --type=service --state=running

When you execute the above-mentioned command, a list of all the running services in Debian 10 will be displayed on your terminal, which is shown in the following image:

Method # 2: Using the “systemctl” command without the “list-units” Parameter in Debian 10:

You can use the “systemctl” command without the “list-units” parameter to list down all the running services in Debian 10 in the manner shown below:

$ systemctl --type=service --state=running

When you execute the above-mentioned command, a list of all the running services in Debian 10 will be displayed on your terminal, which is shown in the following image:

Method # 3: Using the “pstree” Command in Debian 10:

You can use the “pstree” command to list down all the running services in Debian 10 in the manner shown below:

$ pstree

When you execute the above-mentioned command, a list of all the running services in Debian 10 will be displayed in a nice and clean tree-like structure on your terminal, which is shown in the following image:

Conclusion:

The three methods shared with you in this article aimed to demonstrate to you how you can list all the running services in Debian 10. You can employ the very same methods on Ubuntu 20.04 and Linux Mint 20, whereas the commands for CentOS 8 may differ slightly. Nevertheless, you can conveniently pick any method of your choice out of the ones shared with you in this article for listing down all the running services in Debian 10.

]]>
Debian Server vs. Ubuntu Server Comparison https://linuxhint.com/debian-server-vs-ubuntu-server/ Tue, 02 Mar 2021 13:03:21 +0000 https://linuxhint.com/?p=92431 When setting up a new server, a major concern that users may have is which OS to use. Many choices come into mind when it comes to the operating system to use, so selecting just one OS can be a tough choice. It is necessary for a user to compare different server types to select one that fits his or her requirements. In this article, we will compare and contrast Debian and Ubuntu servers.

Debian and Ubuntu servers are considered quite similar in many respects. Let us dig deep into a comparison of the two servers:

Upgrading the Servers

The basic difference between the two server types is the methods in which the two releases are handled. Debian is becoming quite similar to Ubuntu, but both are not totally alike. Rather, each server type has its own distinct set of differences. Debian will not offer the conventional updates that Ubuntu does; rather, Debian offers live streams of the release. An example is the apt-get package manager, which allows users to install updates and software. Users can upgrade their systems to the upcoming stable release without any kind of reboot.

Ubuntu supports its LTS (Long Term Support) version, a version of the distribution that is built upon and supported for roughly five years. On the other hand, Debian offers a total of three years of support with their respective builds. Today, Debian is becoming more and more like Ubuntu, and it has a volunteer support team to help it catch up.

Security of Setups

Ubuntu is a more secure system than Debian. Debian is considered a much stabler system and is much easier to manage than Ubuntu. In discussions on several platforms, Debian has a reputation for being more stable. There may also be a few vulnerabilities in an Ubuntu server that will not exist in a Debian server. Still, overall, Ubuntu and Debian are both widely used all over the world.

Server Support

The two servers also vary in terms of the services offered by each. Ubuntu’s support team can be hired, which can help you with installation, updating, and troubleshooting the system. Debian has no such support team; rather, Debian relies on a team of volunteers. Over time, Debian has gained the status of being a more user-friendly server. Both systems have a detailed installation process, so choosing one of them according to this criterion is an easy decision.

Support for Hardware and Software

Both server systems are based on Debian, so the software and hardware of both systems are pretty much the same. Most Ubuntu packages can run easily without any external software configurations. Meanwhile, Debian servers look for pre-existing configurations while making system updates, then they will notify the system administrators. This ability facilities users and will stop any upcoming software update errors.

Cost

Both servers come free of charge, so the price factor is not the deciding factor of which server to choose. Because both servers are free, users can opt for the operating system that is up to their requirements. You can also switch between the two systems whenever you want, but make sure that all pre-requisites are met before switching.

Conclusion

Debian and Ubuntu servers are equally useful for different purposes. This article compared and contrasted the two servers in detail based on various parameters and characteristics.

]]>
Debian Disable ipv6 on Interface https://linuxhint.com/debian-disable-ipv6-on-interface/ Tue, 02 Mar 2021 12:54:16 +0000 https://linuxhint.com/?p=92419 When you run Debian 10, the IPv6 network connections are enabled by default. But, in most situations, you need to disable the default setting of IPV6. However, we will give you a complete demo on how to disable the IPV6 interface on Debian 10 system.

To execute all commands, you must have the privileges to run the system administrative commands.

First, check if IPV6 is enabled on your Debian system or not. Open the terminal by typing the “terminal” in the search bar, and then click on the displaying Terminal icon in search results. Use the following command to check your IP address:

$ ip a

The following result will show on your terminal to determine if IPV6 is enabled.

Disable IPV6 through systemctl:

Using the following three commands input, you can disable the IPV6 on your system:

$ sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
$ sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
$ sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1

After running the above commands, the IPV6 services will be disabled on your Debian system, but this is only a temporary solution. When you restart your system, it will enable it again. Verify the status by typing the “ip a” command.

To disable these IPV6 connections, you need to use /etc/sysctl.conf file. Open this configuration file in any available editor. Here, we are using a nano editor for modifying this file, as shown in the command below:

$ sudo nano /etc/sysctl.conf

Now, paste the following lines in this file and save it:

net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1

Paste the below-mentioned line, if you have any specific network interface adopter such as “enp0s3”:

net.ipv6.conf.enp0s3.disable_ipv6 = 1

To verify the change settings, type the following command:

$ sudo sysctl -p

Method 1: Using sysctl.d directory

Create file in the /etc/sysctl.d directory using the following command:

$ sudo nano /etc/sysctl.d/disable-ipv6.conf

Paste the following line in this file:

net.ipv6.conf.all.disable_ipv6=1

Save and press ‘Ctrl +X’ to exit from this window.

Now, check the effect of the changes using the following command:

$ sudo sysctl -p -f /etc/sysctl.d/disable-ipv6.conf

Run the following command to verify the results:

$ ip a

As you can see in the above output, IPV6 connections have been disabled on this system.

Conclusion

We have provided you the brief information about how you can disable the IPv6 interface on your Debian 10 system. All these commands can also be executed on the Ubuntu system. If you find this article useful, then let us know with your feedback.

]]>
How to setup GOGs on Linux https://linuxhint.com/setup-gogs-linux/ Tue, 02 Mar 2021 05:41:18 +0000 https://linuxhint.com/?p=92288 Version control systems are the king of collaborative development in the modern world. From major projects such as the Linux kernel, Google Kubernetes, and many more, vcs play a huge role in making the functionality of collaborative development easier.

One of the popular version control systems is git, which serves developers from their local systems to the cloud. Now, there are various ways through which you can utilize the power of git, for example, paying for remote repositories on services such as GitHub, GitLab, and many more. You can also build your own git system hosted on a server on the cloud and use it for your own projects and teams.

This tutorial will learn how to set up your version control system on Linux using Debian 10 and GOGs. Stay tuned to the end to learn more.

Introduction to GOGs

GOGs is a simple, painless self-hosted Git service written in Go language. It is simple, and it does not require heavy computing resources. Due to the nature of its programming language, GOGs is also incredibly fast.

GOGs is a popular choice for anyone looking to set up their own private git service without paying for a server on GitHub providers.

This tutorial will use a local Debian system, Go programming language, and MySQL as the database.

Installing Go Lang

Go is a fast, open-source programming language that is efficient at building applications. Since GOGs is written in Go, we need to install it before compiling GOGs on the system.

Installing Go language is simple.

First, open the terminal and download the go archive using wget as:

wget https://golang.org/dl/go1.15.8.linux-amd64.tar.gz

Next, extract the archive in /usr/local directory:

tar -C /usr/local -xzf go1.15.8.linux-amd64.tar.gz

Once we have extracted the archive, we need to export the go binary location to the path in the .bashrc file.

Edit the file and add the following entries

export GOPATH=$HOME/go
export GOROOT=/usr/local/go
export PATH=${PATH}:$GOROOT/bin

Now save the file and apply the changes by sourcing the bashrc file:

source .bashrc

Now verify that go is installed by calling the command go:

go version

Installing the Database

Let us now build the backend database for the GOGs system. It is good to note that a database is completely optional, and GOGs will run with or without it.

The first step is to ensure you have your system is up to date:

sudo apt-get update && sudo apt-get upgrade

Next, install the MySQL server:

sudo apt-get -y install mysql-server

Next, launch the SQL shell and enter the commands:

mysql> CREATE USER 'gogs'@'localhost' IDENTIFIED BY 'password';
mysql> CREATE DATABASE gogs;
mysql> GRANT ALL ON gogs.* TO 'gogs';

Installing GOGs

Now that we have all the requirements to run GOGs on our system, we can proceed to compile the application.

First, download it using the git clone command:

git clone --depth 1 https://github.com/gogs/gogs.git gogs

Navigate to gogs directory

cd gogs

Compile the main program

go build

Once completed, launch the gogs binary:

./gogs web

This will launch the webserver and listen for incoming http connections.

Configuring GOGs

Once the webserver is running, launch the gogs web interface using the address http://localhost:3000

This will launch the GOGs installer allowing you to configure GOGs backend.

Modify the information as we created in the MySQL database earlier.

Database type = MySQL
Host = 127.0.0.1:3306
User = gogs
Password =
Database Name = gogs

Once you have configured the server correctly, create an admin account and start using GOGs.

If you are looking for a git tutorial, consider the article on how-to-install-and-use-git-on-Linux.

Conclusion

In this quick guide, we discussed installing and using GOGs, a self-hosted git service on a Debian system. This tutorial can be expanded greatly to host GOGs on a live server with a web address. However, it is a good starter guide for beginners.

]]>
How to Install TeamSpeak on Debian 10 https://linuxhint.com/install-teamspeak-debian-10/ Tue, 02 Mar 2021 05:36:23 +0000 https://linuxhint.com/?p=92285 Gaming and work collaboration has become an integral part of our lives, and in the process, made communicating with other people essential. This tutorial will show you how to set up a voice server using TeamSpeak.

TeamSpeak is a virtual intercom that allows you to communicate with other people connected to the server. TeamSpeak is popular in gaming events, but in recent years, many people have adopted it for work events, collaboration on projects, and even friendly communications between family and friends.

Installing TeamSpeak Server

To get started, we need to install the TeamSpeak server. Start by launching your browser and navigate to:

https://teamspeak.com/en/downloads/#server

Under Linux, select 32bit or 64bit—download according to your system.

Now that you have the TeamSpeak Server downloaded, we can proceed to the next step.

You can also use the wget command to download the TeamSpeak archive as:

wget https://files.teamspeak-

services.com/releases/server/3.13.3/teamspeak3-server_linux_amd64-3.13.3.tar.bz2

Now extract the archive with tar command as:

tar -xvf teamspeak3-server_linux_amd64-3.13.3.tar.bz2

Next, navigate to the extracted directory and run create a file “.ts3server_license_accepted”. Add the line “license_accepted=1

sudo touch .ts3server_license_accepted

license_accepted=1

Next, launch the server using the command:

./ts3server_startscript.sh start

Next, note all the information printed, including usernames and passwords. These are important, and you will require them to log in.

------------------------------------------------------------------

I M P O R T A N T

------------------------------------------------------------------

Server Query Admin Account created

loginname= "serveradmin", password= "V7+4mpYV"

apikey= "BAAvWDVfmburJhB0n_tSYPl8UVapmcVK13V4Tx-"

------------------------------------------------------------------

------------------------------------------------------------------

I M P O R T A N T

------------------------------------------------------------------

ServerAdmin privilege key created, please use it to gain

serveradmin rights for your virtual server. please

also, check the doc/privilegekey_guide.txt for details.

token=zM0rOTxDnCPrOxSDGRGLBKQ1sbvBpFxqsPqkV8tF

------------------------------------------------------------------

Installing The TeamSpeak Client

To login into the TeamSpeak server, you will need to have a TeamSpeak Client. Navigate to the resource page below and download the client for your system.

http://teamspeak.com/downloads

Once downloaded, launch the client and enter the IP address to your TeamSpeak server.

Next, provide the server name and password created in the initial launch of TeamSpeak.

Click on connect, then provide the server token and paste it.

Conclusion

You now know how to install TeamSpeak on Debian 10 and connect to it.

]]>
How to Install and Use WeeChat on Debian 10 https://linuxhint.com/install-use-weechat-debian/ Tue, 02 Mar 2021 05:32:41 +0000 https://linuxhint.com/?p=92310 Most of us are familiar with messaging tools such as Facebook, Twitter, WhatsApp, and other fringe ones like Signal. However, most of us don’t know that it’s possible to combine the terminal and social messaging into a powerful force.

In this tutorial, we will discuss using Weechat for Internet Relay Chats on Debian 10. If you’re new to using IRC, this tutorial will help you get started:

Let’s start at the very beginning:

What Is IRC?

Before we get into how to use WeeChat for IRC, let us define a few terms that will make it easier to understand everything we shall discuss:

IRC or Internet Relay chat is a type of application layer protocol used to create and manage IRC networks. IRC networks involve a client/server model that uses a simple IRC client such as WeeChat and a Server to connect to the network.

IRC servers are responsible for transporting messages to users in the connected IRC channels. A collection of more than one IRC server makes up an IRC network, allowing real-time communication between devices.

IRC networks have channels that users can join and communicate within that specific channel. Any registered user in the IRC network can create a channel and share it with other users who want to join.

Users can also create private channels that are usually private and hidden. An example of a channel is the #debian or #ubuntu for Debian and Ubuntu, respectively.

IRC channels are usually prefixed by a pound sign # followed by the channel name.

Users on an IRC network are managed by various characteristics such as their nickname, username, IP address, and real name.

An IRC nickname is a set of characters freely chosen by the user. Nicknames in an IRC network should be unique to each user. You will often hear them referred to as an IRC handle.

The username is simply an identifier for the specific user, which is different from the nickname. Usernames do not necessarily have to be unique.

The IP is simply the internet address of the host device from which the user is connecting.

The real name is an optional identifier that can help identify the user’s real name.

A typical user identity on an IRC is as:

nickname!username@ip

With the basics nailed down, let’s move on and discuss how we can use WeeChat to connect to IRC networks.

Introduction to WeeChat

WeeChat is a simple, powerful, and intuitive C language-written IRC client. WeeChat is cross-platform and can run on Windows, Linux, and macOS. It is highly flexible and supports tool integration written in other programming languages such as Perl, Python, and Ruby.

Since WeeChat is cross-platform and terminal-based, making it a popular choice for many IRC users. It allows terminal customization and extensibility using extensions.

It also allows you to leave the IRC client running in the background as you use the terminal for other remote or local sessions.

Check the official WeeChat site for more details about its capabilities:

https://weechat.org

We need to install WeeChat before we can use it on our system:

How to Install WeeChat

This tutorial only covers WeeChat installation on a Debian system. Check the official documentation for other installation instructions.

https://weechat.org/doc/

WeeChat is available in the official Debian repositories.

Start by updating the system repos using the command below:

sudo apt-get update && sudo apt-get upgrade.

Once we have the system up to date, we can install WeeChat using the command:

sudo apt-get install weechat -y

Running WeeChat

Once you have WeeChat installed on your system, you can launch it by executing the command WeeChat in the terminal.

This command will launch the WeeChat tool as:

How to Use WeeChat

Once you are ready to use WeeChat, we can get started. The first thing we need to learn is how to connect to an IRC server.

Add and Connect to an IRC server

Before we can connect to any IRC server using WeeChat, we need to add it using the /server command:

Here’s an example of adding a Freenode server:

/server add freenode chat.freenode.net

The above command tells WeeChat to add the server chat.freenode.net under the name Freenode.

You are free to use any suitable name for the servers you add.

Once you have a server added, we can connect to it using the /connect command:

For example, to connect to the Freenode server, we added:

/connect freenode

Once you have connected to an IRC server, you can join any channels available in the server using the /join command as:

For example, to join the Debian IRC channel:

/join #debian

To leave a channel or part a channel that keeps the buffer open, you can use the command:

/part [message]

To completely close and leave the channel, use the /close command.

/close

Managing channel buffers

A buffer refers to a component linked to a plugin using a numerical value, a category, and a name. A window is a view on a buffer. By default, WeeChat only displays one window on one buffer. However, you can split windows to view multiple windows with multiple buffers in a single instance.

Check out the IRC documentation to learn more about buffers and windows.

https://modern.ircdocs.horse/

You can use the following commands to manage buffers and windows.

For buffer, use the command:

/buffer

For windows, use the command:

/windows

For example, to split your screen into a large window, use the command:

/window splitv 30

You can remove the split by merging the windows using the command:

/window merge

To switch between buffers, you can call them using the number or their name. For example, to switch to buffer one or buffer #debian respectively:

/buffer 1 or /buffer #debian

WeeChat also supports shortcuts to navigate between buffers. For example, use the ALT+number where the number is the buffer to switch to.

NOTE: By default, WeeChat does not display buffer names or numbers; you will need to install buffer.pl plugin to enable this feature. Check how to install a WeeChat plugin below.

Sending IRC private Messages

You can open a buffer to send a private message to a specific user in an IRC channel.

The general syntax is:

/msg nick message

For example, to send a message to a linuxhint user, use the command:

/msg linuxhint “Check out other articles to gain more knowledge”

If you want to establish a consistent buffer for sending private messages, you can use the /query command.

For example:

/query linuxhint

The command above will open a conversation buffer between you and the specified user.

How to Configure WeeChat

WeeChat is a useful tool for IRC. It provides a wide range of tools and configurations. You can edit the configuration file located in ~/.weechat or use commands to edit the configuration.

WeeChat config Commands

You will mainly use WeeChat commands to interact with users and perform configurations.

All Weechat commands have a preceding forward-slash (/), with most of the commands supported within IRC channels.

Some of WeeChat commands include:

  1. /help – it displays available commands or helps for a specific passed command.
  2. /quit – closes WeeChat sessions.
  3. /close – terminates a specific buffer in WeeChat.
  4. /join – joins a specified channel.
  5. /ms.- sends a private message to a specific user in the current buffer.
  6. /query – opens a private buffer to the specific user.
  7. /kick – removes a user from a channel.
  8. /ban – bans a specific user from a channel.
  9. /kickban – kicks out and bans a user from the channel.
  10. /topic – specifies topic channel.
  11. /whois – displays information about a specified user.
  12. /part – leaves the channel but does not terminate the buffer.

Those are some of the commands you can use to interact and configure WeeChat. To learn more, check out the official documentation.

https://weechat.org/files/doc/stable/weechat_quickstart.en.html#buffer_window

How to Install WeeChat Plugins

WeeChat allows you to extend features and functionality using Plugins, which, in essence, are modifications or extensions of the WeeChat tool. To install a plugin, we use the /script command.

For example, to install the buffer plugin:

/script install buffer.pl

You should always provide the name of the plugin, including the extension.

To view all the scripts available, use the /script command with no arguments.

To get a list of all WeeChat scripts, use the resource provided below:

https://weechat.org/scripts/

How To Setup IRC Nickname and Username

You can also set up the default nickname and username that WeeChat uses on connect. This will remove the hustle of setting up the nickname or username every time you connect to a network.

To set a default nickname, use the command:

/set irc.server_default.nicks "yournickname"

NOTE: You can pass a set of nicknames in case one of them.

To set a default username, use the command:

/set irc.server_default.username "yourusername"

To change an already connected nickname, use the /nick command as:

/nick mynewnickname

Conclusion

We have gone over what IRC networks are, the basics of how they work, and how to install an IRC client on Debian systems and use it to connect to IRC networks. Although this tutorial is short and quick, it covers everything you need to get started with IRC.

To learn more about IRC(s), check out other IRC tutorials on our website.

]]>
How do I Upgrade my Linux Kernel Version on Debian 10? https://linuxhint.com/upgrade-linux-kernel-version-debian-10/ Fri, 26 Feb 2021 00:24:04 +0000 https://linuxhint.com/?p=91663 The kernel in Linux acts as a bridge to enable communication between software/applications and your machine’s hardware. It acts as the backbone of your operating system upon which the normal processing of all your system functions is based. That is why it is always good to keep it updated and upgraded regularly. In today’s article, we will be exploring the procedure of upgrading our Linux kernel version on Debian 10.

Method of Upgrading your Linux Kernel Version on Debian 10:

For upgrading your Linux kernel version in Debian 10, you have to perform the following four steps:

Step # 1: Checking the Current Kernel Version on Debian 10:

First, you should check the current version of the kernel installed on your Debian 10 system to verify if it has been upgraded or not later on. For checking the current kernel version in Debian 10, you will have to execute the command stated below:

$ uname –sr

The currently installed kernel version on our Debian 10 system is Linux 4.19.0-9-amd64, as shown in the following image:

Step # 2: Update your Debian 10 System:

You also need to update your Debian 10 system before upgrading its kernel version. Your system will look out for the available upgrades for the kernel and mark them for installation by updating them. You can update your Debian 10 system with the command shown below:

$ sudo apt-get update

When all the necessary packages on your Debian 10 system is updated, this command will finish its execution as shown in the following image:

Step # 3: Upgrade the Kernel in Debian 10:

Now we can finally attempt to upgrade our Linux kernel version in Debian 10 with the help of the command shown below:

$ sudo apt-get dist-upgrade

We have used the “dist” parameter with the “upgrade” command to smartly manage the up-gradation process by installing the required packages and removing the irrelevant ones at the same time.

During the execution of this command, you will be asked to confirm this action because doing so will occupy some additional space on your system. You can confirm the up-gradation process by pressing the “Y” key and then hitting the Enter key as shown in the following image:

When the up-gradation process finishes, the Linux kernel version on your Debian 10 system will also have been upgraded.

Step # 4: Verify the Kernel Version Upgrade in Debian 10:

To verify if the kernel version is upgraded on your Debian 10 system or not, you can run the “uname –sr” command once again, and you will be able to notice a change in your kernel version from the previous time. However, in our case, we already had the latest kernel version installed on our Debian 10 system. That is why we could not upgrade it any further and received the same kernel version as the output of the “uname –sr” command that we had received earlier. This is shown in the image below:

Conclusion:

By going through the procedure described in this article, you can conveniently upgrade your Linux kernel version in Debian 10 at any time you want. It is highly recommended that you keep repeating this process after regular intervals for your Debian 10 system’s proper functioning.

]]>
Best Debian 10 Netstat Alternative https://linuxhint.com/best-debian-netstat-alternatives/ Thu, 25 Feb 2021 23:24:39 +0000 https://linuxhint.com/?p=91610 The Socket Statistics, or ‘ss,’ command has replaced the netstat command through its incorporation of the iproute suite of tools. Using the ss command, a user can print all the relevant information about network socket connections more quickly and with more detail than the netstat command. The netstat command approach is also slower because it collects information from reading the /proc files, and it takes a significant amount of time to display several network connections at once. Meanwhile, the ss command directly collects information from kernel space. Even so, the options that are used with ss command are quite similar. So, you can easily use the ss command as an improved alternative for the netstat command.

This article covers the usage of the ss command with some straightforward examples. All the commands shown in this article were executed on the Ubuntu 20.04 distribution to check the statistics of socket and network connections.

Example 1: List Network Connection Using ss Command

You can easily list all network connections present in a system, including TCP, UDP, and UNIX socket connections, using the following ss command. The output is displayed in “less” format so that you can scroll through the output window:

$ ss | less

Example 2: List TCP, UDP, & Unix Socket Connections

You can also filter out the TCP, UDP, and UNIX socket connections using the following options:

Using only the “t” option displays connections that are ‘Connected’ or ‘Established.’ This option alone does not show you the TCP socket connections that are ‘Listening.’

$ ss –t

For TCP, use the ‘-t’ option, along with the ‘-A’ tag.

$ ss -A tcp

For UDP connections, use the following command:

$ ss -ua

$ ss -a -A udp

The ‘a’ option displays both ‘Connected’ and ‘Listening’ sockets. UDP is a connectionless protocol, so using ‘ss -u’ alone will not display anything. However, the ‘a’ can be used to show all UDP connections.

For Unix socket connections, use the following command:

$ ss x

Example 3: Display Faster Output

The “n” option used with ‘t’ prevents socket statistics from resolving IP addresses to hostnames and displays the faster output, as follows:

$ ss -nt

Example 4: Display Listening Sockets Only

You can also display only the TCP socket connections that are listening. The “n” option ignores resolving the hostnames of the IP address to display the output more quickly.

$ ss -ltn

For all UDP listening connections, replace the ‘t’ option with the ‘u’ option, as follows:

$ ss -lun

Example 5: Display Process Name with pid

You can display the process name, along with the pid of each process, using the following ss command with the ‘-ltp’ option:

$ sudo ss –ltp

Example 6: Display Statistics

The use of the ‘s’ option with the ss command displays the complete statistics, as follows:

$ ss -s

Example 7: Display Timer Details of Connection

By using the ‘-o’ option with the ss command, you can display the time information of each connection. The time details inform the user how long this connection has been maintained:

$ ss -tn -o

Example 8: Print IPV6 or IPV4 Socket Connection

To print the IPv4 socket connections only, use the ‘-4’ option with ‘-f inet,’ as follows:

$ ss –tl4

$ ss -tl -f inet

For IPV6, use the ‘-6’ option or ‘-f inet.’

$ ss -tl6

Example 9: Filter TCP Connections by State

You can also filter connections by connection state with the ss command. Connections can exist in various states, such as established, syn-recv, syn-sent, fin-wait-1, fin-wait-2, time-wait, close-wait, closed, all, last-ack, closing, connected, bucket, synchronized, and bucket.

So, according to the user requirements, you can use and filter any connection state by running the following command:

$ ss [ OPTIONS ] state [ State-name ]
$ ss -t4 state established

In the above example, we filtered all ‘established’ socket connections of TCP.

$ ss –t4 state time-wait

$ ss –t4 state connected

Example 10: Filter Address by Port Number

You can also filter the connection by the port number or by a specified IP address, as follows:

$ ss –nt dst 127.0.0.1:45807

$ sudo ss –ntlp sport gt :5000

Conclusion

This article explored the various uses of the ss command. The ss command is the best alternative for the netstat command, as you have seen in this tutorial. Using the above examples, you can easily monitor system sockets and network connections.

]]>
Install Python PIP Debian 10 https://linuxhint.com/install-python-pip-debian-10/ Sun, 21 Feb 2021 21:02:20 +0000 https://linuxhint.com/?p=90773 PIP is a command-line package manager of python that allows you to manage and install new python-based software packages.  Using this tool allows users to search for packages from the python packages index as well as install its dependencies. Python pip-tools are not readily installed on most Linux operating systems. However, you can manually install the python-pip utility on your Debian and other Linux distributions.

Today, we will show how you can install python-pip packages on the Debian 10 system through the command-line application. All commands of this article have been implemented on the Debian 10 buster environment. Almost all these steps can also be used on Ubuntu and Linux Mint operating environments.

Pip Installation on Debian 10 system

Python has two different versions, python2 and 3. However, you need to separately install python pip-tools for both python versions. Open the terminal from the application menu and then start the installation of a python-pip using the following method:

Install pip for python2

The following steps are included while you install the pip tool for python2 on Debian 10:

Step 1: Update system packages 

Run the following command to update the system package list:

$ sudo apt update

Step 2: Install Pip

First, ensure the installation of python2 on your system by running the following command:

$ python2 -V

The installed version will be displayed on the terminal. Now, type the following command to install the pip tool for Python2:

$ sudo apt install python-pip

The above command will automatically install pip with all its dependencies on your system.

Step 3: Check pip version

Once all packages are installed, issue the following command to check the installed version of the pip tool for python2:

$ pip –version

The installed version will be displayed on the terminal after running the above command.

Install Pip for python 3

Similarly, the following command you need to implement on the terminal to install pip-tools for python 3 is shown below:

Step 1: Update the Packages list by running the following command:

$ sudo apt update

Step 2: Install pip along with all dependencies for python 3 by executing the following command:

$ python3 –V

$ sudo apt install python3-pip

Step 3: verify the pip installation using the following command:

$ pip3 --version

Use of Pip 

We will also explore the use of pip in this article. By using pip, the user can install python packages from PyPI, local projects, version control, and other project distributions. Usually, the pip would be used inside the virtual environment. Python virtual environment allows you to install python packages inside an isolated space without disturbing the other python project modules.

Let’s discuss some useful pip commands that are mentioned below.

With pip, you can list all packages, as follows:

$ pip list

You can search for a package through pip, using the following command:

$ pip3 search “package-name”

With pip, you can install a python package from PyPI, as follows:

$ pip3 install package-name

For example, we want to install a python package ‘scrapy’ through pip. So, the following command is what you need to enter on the terminal:

$ pip3 install scrapy

You can also display the package information using the following commands:

$ pip3 show package-name
$ pip3 show wheel

The command below allows you to remove or uninstall a package through pip3:

$ pip3 uninstall package-name

To uninstall the scrapy package, run the below-mentioned command:

$ pip3 uninstall scrapy

That’s all about the basic commands of the pip tool. To explore more commands and options about pip, run the following command on the terminal:

$ pip3 –help

All pip commands and option will be displayed on the terminal as follows:

Conclusion

In this article, we have learned how to install the python-pip tool for python 2 and python 3 on the Debian 10 buster system. We have executed various commands to understand the use of pip. Moreover, we have also explained the use of the pip tool.

]]>
How to Install SOGo Groupware on Debian 10 https://linuxhint.com/install-sogo-groupware-debian/ Wed, 03 Feb 2021 04:08:56 +0000 https://linuxhint.com/?p=88626 SOGo Groupware is a free and modern scalable collaboration software. It allows users to share calendars, emails, and address books with the community through a web interface. SOGo web interface supports various native clients such as Mozilla Thunderbird and Lightning using the same standard protocols such as Microsoft ActiveSync, CardDAV, and GroupDAV. It is mostly used in production environments where we are dealing with several users. In this post, we will describe how to install SOGO Groupware on the Debian system.

Note: We will be explaining the commands and procedure on Debian 10 (Buster) system. You should

Installing SOGo Groupware on Debian 10

Step 1: Install Apache

Firstly, update the system repository index as follows:

$ sudo apt update

Enter the sudo password.

Now install Apache using the below command in Terminal:

$ sudo apt install apache2

Step 2: Install and Configure MariaDB

We will need to install MariaDB as a database backend for SOGo. Execute the below command to install the MariaDB server on your system:

$ sudo apt install mariadb-server

Now you might be prompted with the Y/n choice to carry on the installation of MariaDB. Press Y to proceed.

Now execute the below command in Terminal to improve the security of your MariaDB installation:

$ sudo mysql_secure_installation

When asked to enter the current password for root, just press Enter. After that, you will be asked to set a new root password so that no one can login as a MariaDB root user without authentication. Press y if you want to set a new password for MariaDB root. Then enter the password twice.

Now press y for all subsequent questions also shown highlighted in the following screenshot.

Step 3: Install SOGo

Sogo can be installed easily via an apt command-line utility. However, we will first need to add its repository to our system’s local repositories. Follow the below steps to do so:

To install SOGo in your Debian system, first, add the SOGo repository to the sources.list file. In the Terminal, execute the below command to edit the sources.list file:

$ sudo nano /etc/apt/sources.list

Now to add the SOGo repository, add the below line at the end of the file:

deb http://packages.inverse.ca/SOGo/nightly/2/debian/ buster buster

Now save and close the sources.list file.
Add key for SOGo repository using the following command:

$ sudo apt-key adv --keyserver keys.gnupg.net --recv-key 0x810273C4

After adding a new repository, you will need to update the local repository index. Use the below command to do so:

$ sudo apt update

Once the update is completed, you can install SOGo as follows:

$ sudo apt install sogo

Now you might be prompted with Y/n (yes/no) option for proceeding with the installation. Press Y to proceed.

Once SOGo is installed, start its service using the below command:

$ sudo systemctl start sogo

To automatically start the SOGo service at boot, execute the below command in Terminal:

$ sudo systemctl enable sogo

Now start MySQL using the below command in Terminal:

$ sudo mysql

Now we will create a database and a user. Issue the following to create a database “sogo”:

$ CREATE DATABASE sogo;

Now create a user named “sogo” with the password “password”.

$ GRANT ALL ON sogo.* TO 'sogo'@'localhost' IDENTIFIED BY 'password';

First, connect to the database to run subsequent commands:

$ USE sogo;

Then create a database table to hold user information.

$ CREATE TABLE sogo_users (c_uid VARCHAR(10) PRIMARY KEY, c_name VARCHAR(10), c_password VARCHAR(32), c_cn VARCHAR(128), mail VARCHAR(128));

Now add an entry in the table for a user:

$ INSERT INTO sogo_users VALUES ('sim', 'sim', MD5('sim123'), 'Sim Sam', sim@ domain.com');
$ flush privileges;
$ exit;

Now we will have to enable some of the Apache modules. Execute the below command in Terminal to do so:

$ sudo a2enmod proxy proxy_http headers rewrite

After the modules are enabled, restart apache as follows:

$ sudo systemctl restart apache

Step 4: SOGo Configuration

Now we will configure SOGo to make it use the MySQL database that we have created in previous steps. We will do configurations under the user “sogo”. For this purpose, issue the following command to change the user:

$ su sogo

Then execute the below commands for SOGo configurations. Make sure to replace the Country/Region with your timezone, and domain.com with your actual domain. Also, replace password with the password you have set during database creation.

$ defaults write sogod SOGoTimeZone "Country/Region"
$ defaults write sogod SOGoMailDomain "domain.com"
$ defaults write sogod SOGoLanguage "English"
$ defaults write sogod SOGoUserSources '({canAuthenticate = YES; displayName = "SOGo Users"; id = users; isAddressBook = YES; type = sql; userPasswordAlgorithm = md5; viewURL ="mysql://sogo:<strong>password</strong>@127.0.0.1:3306/sogo/sogo_users";})'
$ defaults write sogod SOGoProfileURL 'mysql://sogo:password@127.0.0.1:3306/sogo/sogo_user_profile'
$ defaults write sogod OCSFolderInfoURL 'mysql://sogo: password @127.0.0.1:3306/sogo/sogo_folder_info'
$ defaults write sogod OCSSessionsFolderURL 'mysql://sogo: password @127.0.0.1:3306/sogo/sogo_sessions_folder'
$ defaults write sogod SOGoLoginModule Calendar
$ defaults write sogod SOGoSieveScriptsEnabled YES
$ defaults write sogod SOGoAppointmentSendEMailNotifications YES
# The default port for SOGoSieveServer was 2000 but now it is 4190
$ defaults write sogod SOGoSieveServer sieve://localhost:4190
$ defaults write sogod SOGoVacationEnabled YES
$ defaults write sogod SOGoMailMessageCheck every_5_minutes
$ defaults write sogod SOGoFirstDayOfWeek 1
# following is the configuration for mailbox
$ defaults write sogod SOGoSentFolderName "INBOX.Sent"
$ defaults write sogod SOGoTrashFolderName "INBOX.Trash"
$ defaults write sogod SOGoDraftsFolderName "INBOX.Drafts"
$ defaults write sogod NGImap4ConnectionStringSeparator "."
$ exit

Now restart SOGo service using the below command:

$ sudo systemctl restart sogo

Now modify the SOGo configuration file for apache to use localhost with no SSL. You can find the SOGo configuration file for Apache at /etc/apache2/conf.d/SOGo.conf.

Edit the file using the below command:

$ sudo nano /etc/apache2/conf.d/SOGo.conf

Now find the following lines and replace 443 with 80 and yourhostname with localhost.

RequestHeader set "x-webobjects-server-port" "<strong>443</strong>"
RequestHeader set "x-webobjects-server-name" "<strong>yourhostname</strong>"
RequestHeader set "x-webobjects-server-url" https://yourhostname

It should now look like this:

RequestHeader set "x-webobjects-server-port" "80"
RequestHeader set "x-webobjects-server-name" "localhost"
RequestHeader set "x-webobjects-server-url" "http://localhost"

Then to check for any configuration errors, execute the below command in Terminal:

$ sudo apachectl configtest

If you receive the following output, it means configurations are fine.

Syntax OK

Now restart the Apache server as follows to apply the configuration changes:

$ sudo systemctl restart apache2

Now access the following address in any web browser from the same system on which SOGO is installed:

http://localhost/SOGo

You should now see the SOGo login page where you can log in using your admin username and password, which are ‘sim’ and ‘sim123’.

Uninstalling SOGo

In case you no longer need SOGo Groupwarw, you can easily remove it from your system. Execute the below command in Terminal to uninstall SOGo from your Debian system:

$ sudo apt remove sogo

When you install SOGo, some dependencies are also installed with it. To remove those dependencies too, execute the below command in Terminal:

$ sudo apt remove --auto-remove

Alternatively, if you want to uninstall SOGo along with all configuration files, execute the below command in Terminal:

$ sudo apt purge sogo

Then to remove the dependencies too, execute the below command in Terminal:

$ sudo apt purge --auto-remove

That is all there is to it! In this post, you have learned how to install and configure SOGo groupware on Debian OS. For advanced configurations, visit SOGo official documentation. ]]> How to Install Diaspora Decentralized Social Media on Debian 10 https://linuxhint.com/install-diaspora-debian-10/ Tue, 02 Feb 2021 19:21:39 +0000 https://linuxhint.com/?p=88783

Diaspora is a privacy-aware distributed and an open-source, decentralized social network. It comprises a collection of independently owned and deployed nodes that are incorporated to create the social network. This article will show the installation procedure of Diaspora distributed social network on the Debian 10 system.

Prerequisites

All commands should run under administrative privileges.

Follow the following procedure to install the diaspora decentralized social media on Debian 10:

Step 1: Install the required packages

Install the required dependencies for diaspora installation such as Redis, PostgreSQL, and Nginx web server.

$ sudo apt-get install build-essential cmake gnupg2 libssl-dev libcurl4-openssl-dev libxml2-dev libxslt-dev imagemagick ghostscript curl libmagickwand-dev git libpq-dev redis-server nodejs postgresql

Enable and start the Redis and PostgreSQL services after completing the installation of required packages. Add all of them to the Debian system boot by using the following commands:

$ systemctl start redis-server

$ systemctl enable redis-server

$ systemctl start postgresql

$ systemctl enable postgresql

Step 2: Create PostgreSQL new user for diaspora

Change the f=default ‘Postgres’ user password and create a PostgreSQL user for the diaspora.

By using the ‘psql’ command, Log in to the PostgreSQL shell.

$ sudo -i -u postgres psql

Now, change the ‘postgres’ default user password by using the following command:

# \password postgres

Enter the new password and again re-enter the password for confirmation.

Create a new user named ‘diaspora’ who have certain privileges ‘CREATEDB’:

# CREATE USER diaspora WITH CREATEDB PASSWORD 'yourpassword';

Type ‘exit’ on the terminal to leave the PostgreSQL shell window.

Step 3: Create a new diaspora user

Once the PostgreSQL user for diaspora is created, you will create a system user named ‘diaspora’ and then include it into the sudo group.

By using the following commands, create a new system user named ‘diaspora’ and assign its password:

$ sudo adduser --disabled-login Diaspora

$ sudo passwd diaspora

Add the above user ‘diaspora’ into the sudo group by running the below-given command:

$ sudo usermod -a -G sudo diaspora

Now, this user can run all administrative sudo commands on this system.

Step 4: Installation of RVM and Ruby Packages

Log in as a diaspora user on your system by executing the following command:

$ su - diaspora

Enter the password that you have been set above for a diaspora system user.

Now, start the installation of Ruby Version Manager (RVM) and install Ruby packages for the ‘diaspora’ user.

Include the RVM GPG key by running the following command:

$ sudo gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

Next, install the RVM by executing the following command:

$ curl -sSL https://get.rvm.io | bash -s stable

Once the RVM installation is completed, load the script on your system by using the following command:

$ source /home/diaspora/.rvm/scripts/rvm

Now, using the rvm commands, you can install ruby packages on your system. So, use the following command to install Ruby 2.6:

$ rvm install 2.6

Once the installation of Ruby is completed, check the installed version by executing the following command:

$ ruby --version

Step 5: Download and set up Diaspora

Download the source code of diaspora by using the following git clone command:

$ git clone -b master <a href="https://github.com/diaspora/diaspora.git">https://github.com/diaspora/diaspora.git

Navigate into the diaspora directory and copy or duplicate the database configuration ‘database.yml’ and the diaspora configuration ‘diaspora.yml’.

$ cd diaspora

$ cp config/database.yml.example config/database.yml

$ cp config/diaspora.yml.example config/diaspora.yml

Open the configuration files in the most friendly nano text editor and edit them.

For database configuration:

$ sudo nano config/database.yml

Edit the PostgreSQL section with your username and password as follows:

postgresql: &postgresql

  adapter: postgresql

  host: "localhost"

  port: 5432

  username: "diaspora"

  password: "yourpassword"

  encoding: unicode

Press ‘Ctrl + O’ to save changes and then press ‘Ctrl +X’ to exit from the nano.

Now, edit the ‘config/diaspora.yml’ file.

$ sudo nano config/diaspora.yml


configuration: ## Section

::::::::::

  environment: ## Section

:::::::::

    url: "https://example.org/"

    certificate_authorities: '/etc/ssl/certs/ca-certificates.crt'

    require_ssl: true

::::::::

  server: ## Section

    rails_environment: 'production'

:::::

Save the configuration exit from the current displaying window by pressing ‘Ctrl+O’.

Now, you need to install the gem and required ruby libraries for the diaspora.

$ gem install bundler

$ script/configure_bundler

$ bin/bundle install --full-index

After that, you need to migrate the database by executing the following command:

$ RAILS_ENV=production bundle exec rake db:create db:migrate

Combine all rails assets as follows:

$ RAILS_ENV=production bin/rake assets:precompile

Step 6: Configure diaspora as a Service

Once the diaspora installation is completed, you will set up the Diaspora as a systemd service.

Navigate into ‘/etc/systemd/system’ directory and create a new service file using the nano editor as follows:

$ cd /etc/systemd/system/

$ sudo nano diaspora.target

Paste the following lines in this file:

Save and exit from the nano editor.

Now, create a new service file named ‘diaspora-web.service’ using the nano command:

$ sudo nano diaspora-web.service

Paste the following code in it:

Save and exit from the nano.

Create a new file for monitoring services with named ‘diaspora-sidekiq.service’ using the nano command as follows:

$ sudo nano diaspora-sidekiq.service

Paste the following configuration code in it:

Save and exit from the current window.

Now, reload the systemd services and enable the following diaspora services on your system:

$ sudo systemctl daemon-reload

$ sudo systemctl enable diaspora.target diaspora-sidekiq.service diaspora-web.service

Now, start all services and get status by using the following commands:

$ sudo systemctl start diaspora.target

Enter the password and continue the process.

$ systemctl status diaspora-web

$ systemctl status diaspora-sidekiq

From the above results, you can verify that the Diaspora is running as a systemd service. The basic configuration for Diaspora has been completed now.

Step 7: Generate SSL certificate

To make your domain more secure, generate the SSL Letsencrypt certificate. For this purpose, install the certbot using the following command:

$ sudo apt install certbot

Generate the SSL letsencrypt certificate by replacing the mentioned domain name with your domain as follows:

You can find your SSL certificate in the ‘/etc/letsencrypt/live/yourdomain.com/’ directory in your system. Now, install Nginx as follows:

Configure diaspora with Nginx.

Testing

Once you have configured all diaspora services, add your domain name to your browser’s address bar.

http://youdomain.com/

Conclusion

That’s all about the Diaspora installation on your Debian 10 system. By using the above steps, you can easily install the Diaspora Decentralized Social Media on your Debian system. Thanks.

]]>
Advanced Network Configuration in Debian 10 (Buster) https://linuxhint.com/advanced-network-configuration-debian-10/ Mon, 25 Jan 2021 18:13:22 +0000 https://linuxhint.com/?p=87611

In this guide, we will see various ways to configure various network operations on the Debian system. Although this guide is for the Debian system, most operations should run on other Debian based systems like Ubuntu and other Linux operating systems as well.

 1. If you want, you can print the IP address of a specific interface or device, just use the below command:

$ ip addr show enp0s8


here enp0s8 is any interface or device. The naming convention may vary depending upon the naming mechanism used.

2. IP command can also be used to show the network performance statistics as follows:

$ ip -s  link show enp0s8


The above command output reveals the number of packets transmitted and received, packets dropped, and the packet with errors. This information can be used to troubleshoot network issues like low memory, connectivity issues, packet congestion, etc.

3. Using nmcli or Network Manager Command Line Interface tool to create a DHCP network connection

$ sudo nmcli con add con-name "MyCon1" type ethernet ifname enp0s8


The above command will create a new connection named “MyCon1” on the device enp0s8. Let us see some details about this command:

  • The configuration of this connection will be based on DHCP. The type of this connection is ethernet. Other types of network connection can be wifi, Bluetooth, vlan, bond, team, bridge, etc.
  • The con-name argument defines the name of the connection.
  • The ifname option specifies the name of the interface or the device assigned for this connection.

4. To create a static connection using nmcli, we will need to specify the IP address and the gateway as the argument

$ sudo nmcli con add con-name “MyCon2” type ethernet ifname eth1 ip4 192.168.2.10/24 gw4 192.168.2.0

To activate the connection, use the following command:

$ sudo nmcli con up "MyCon2"

To verify the new connection, run:

$ nmcli con show –active

$ ip addr show enp0s3

5. Configuring the network with Network Interfaces File

The /etc/network/interfaces file contains the definitions of various interface configurations. We can add configuration details to create a new connection. Let us see some manual configuration:

I. Adding a static IP address:

1. Open the /etc/network/interfaces file with sudo privileges:

$ sudo nano /etc/network/interfaces

Now  add the following lines:

auto  enp0s3

iface enp0s3 inet static

address  192.168.1.63

netmask 255.255.255.0

gateway 192.168.1.1

You can add this configuration to the /etc/network/interfaces file or add it to a new file under the /etc/network/interfaces.d directory.

After modifying the above file, let’s restart the networking service for changes to take effect:

$ sudo systemctl restart networking

Now we will reload this interface by running the command ifdown followed by ifup:

$ sudo ifdown enp0s3

$ sudo ifup enp0s3


The ifup and ifdown commands are used to manage the interfaces defined in this file. These tools are very helpful while configuring the network from the command-line interface. These commands can be found in /sbin/ifup and /sbin/ifdown.

II. Adding a DHCP Address:

The dhcp IP address is automatically assigned from the IP address pool of the DHCP server.

To configure a DHCP address, enter the following line to /etc/network/interfaces file and save the file:

iface enp0s3 inet dhcp


Now restart the networking service and again run the command ifdown and ifup as above:

$ sudo systemctl restart networking

$ sudo ifdown enp0s3

$ sudo ifup enp0s3

To verify the above network configuration, use the following ‘ip’ command to see if the interfaces are shown with their respective ip addresses:

$ ip a | grep 'enp0s3'

Note: DHCP Ip is generally good for clients, but the server usually works on a Static IP address.

6. Setting Hostname with the “Sysctl” command

Linux provides a sysctl utility to display and set the hostname as shown below:

i) Displaying the hostname:

$ sudo sysctl kernel.hostname

kernel.hostname = debian


ii) Setting the hostname

$ sudo sysctl kernel.hostname= linuxhint

Now run the command bash exec to verify the new hostname:

$ exec bash

Now to make this hostname permanent, we will have to edit the /etc/hosts and /etc/hostname files, so open the files and put the new hostname there:

$ sudo nano /etc/hosts

$ sudo nano /etc/hostname

Now from this point, you should see your new hostname every time you open a new terminal.

7. DNS configuration

DNS or domain name service is a naming system that is used to translate domain names into network addresses (IPv4 or IPv6). The DNS service has much more capability than simply translating domain names. The DNS service can work on both internet as well as on a private network.

We will configure a client to use a specific dns server. In the example below, we will configure a client to use a dns server from 8.8.8.8. Open the file /etc/resolv.conf and make the following changes to it:

$ sudo nano /etc/resolv.conf

Go to the line containing the string “nameserver” and add the IP address of the DNS server(8.8.8.8) as shown below:

nameserver 8.8.8.8

8. Using Bonding on Debian 10

Bonding is a method in which two or more interfaces are merged to make a new logical interface. This bonded interface makes the network more reliable. In case a link fails, the other link will automatically balance all the network traffic. This increases the network availability as well. You can try bonding your wireless interface with the cable interface. If for some reason, the ethernet cable is unplugged or not working, the network traffic will automatically start flowing over the wireless interface.

Tip: We can use bonding to add multiple network interfaces (NICs) with the same IP address.

To check if  your linux kernel version supports bonding, use the following command :

$ sudo grep -i bonding /boot/config-$(uname -r)

An output like “CONFIG_BONDING=m” shows that the bonding is enabled as a module

Let us see how to apply bonding on two ethernet interfaces, “eth1″ and” eth2″ on a Debian system. Follow the steps below:

Step 1. Install the ifenslave package to configure bonding:

$ sudo apt install ifenslave

Step 2.  Now bring down the interface before configuring it:

$ sudo ifdown enp0s3

Note: Before proceeding, make sure that the interface you are modifying should not be in use; otherwise, it will break your network connectivity.

Step 3. Create a new bonding configuration and called it “bond1”. To do this, open the default  network configuration file:

$ sudo nano /etc/network/interfaces

Now add the following lines:

auto bond1

iface bond1 inet static

address 192.168.1.200

netmask 255.255.255.0

gateway 192.168.1.1

slaves enp0s8

bond-mode 1

bond-miimon 100

bond_downdelay 200

bond_updelay 200

Restart the networking service

$ sudo systemctl restart networking

Linux supports different bond modes: balance-rr (mode=0), active-backup (mode=1), balance-xor (mode=2), broadcast (mode=3), 802.3ad (mode=4), balance-tlb (mode=5), balance-alb (mode=6). In this example we are using mode 1 or active backup as a bond mode.

Step 4. Bring the new bonded interface (bond1) up with command ifup. Now check if it works:

$ sudo ifup bond1

To check if the bind interface is created, run the following command:

$ ip a | grep 'bond1'

or

$ ifconfig bond1

9. Configuring bridging on Debian

Bridging is the most common way to connect two different networks. A bridge (hardware) device is used when connecting two different networks of an organization, usually located at different locations. Linux system also has the capability to create a bridge between two interfaces having different networks. This way we can pass traffic between them.

Let us create a bridge between two different interfaces, “eth0″ and” eth1,” on a Debian system.

Step 1. Install the “brctl” tool to configure bridging on the Debian system:

$ sudo apt install bridge-utils

Step 2. Run the following command to get a list of all the network interfaces available on your system:

$  ifconfig -a

Step 3. create a new interface using the brtcl tool:

$ sudo brctl addbr br1

This will create a new virtual interface to link between eth0 and eth1.

Step 4. Now add both the interfaces to this virtual interface.

$ sudo brctl addif br1 eth0 eth1

Step 5. To make this configuration permanent, we will add the new interface details to the file /etc/network/interfaces.

i) For setting a DHCP address, use the following details

# The loopback network interface

auto lo

iface lo inet loopback

# Set up interfaces manually, avoiding conflicts with, e.g., network manager

iface eth0 inet manual

iface eth1 inet manual

# Bridge setup

iface br0 inet dhcp

bridge_ports eth0 eth1

Now run the below command to bring the interface up:

$ sudo ifup br1

ii) For setting a static IP address, use the following details

# The loopback network interface

 auto lo br1

 iface lo inet loopback


 # Set up interfaces manually, avoiding conflicts with, e.g., network manager

 iface eth0 inet manual


 iface eth1 inet manual


 # Bridge setup

 iface br1 inet static

    bridge_ports eth0 eth1

        address 192.168.1.2

        broadcast 192.168.1.255

        netmask 255.255.255.0

        gateway 192.168.1.1

Now run the below command to bring the interface up:

$ sudo ifup br1

If the network does not work after rebooting, try removing /etc/network/interfaces.d/setup file to fix the issue.

10. Configuring Networking from  Command-line tools

i) Adding an additional IP address to a network card:

Step 1. Run the following command to list all the available interfaces with their IP address:

$ sudo ip addr

or

$ sudo ifconfig

While running “ifconfig,” you may encounter an error: “ifconfig: command not found”. For fixing this error, we need to install the “net-tools” package:

$ sudo apt install net-tools -y

Step 2. From the output of the above command, you can select the interface on which you want to add an extra IP address. Let us add an extra IP address (10.0.2.65) to the interface enps03.

$ sudo ip addr add 10.0.2.65/24 dev enp0s3

Step 3. Verify if the IP has been added to this interface:

$ ip a | grep "enpo3"

You should see here the new and old IP address in the output.


Step 4. To make this IP address permanent, put the following lines in the  /etc/network/interfaces file:

# The network interface enp0s3 is dhcp enabled

auto enp0s3

iface enp0s3 inet dhcp

iface enp0s3 inet static

address  10.0.2.65/24

Step 5. Now save the file and bring down the interface and then again bring up the interface to apply the changes:

$ sudo ifdown  enpo3

$ sudo ifup  enpo3

Now verify the connectivity of the interface with the ping command:

$ sudo ping  10.0.2.65

If everything goes right, you should see a ping coming from the new IP address.

ii) Changing the mac address of an interface.

Step 1. Run the below command to select the interface for you which you want to change the MAC address for:

$ ip link show

It will show you all the interfaces with their mac address, state, and other information.

Step 2. Let us change the mac address of the “eth0” interface and bring it down:

Note: Before proceeding, make sure that the interface you are modifying should not be in use. Otherwise, it will break your network connectivity.

$ sudo ip link set dev eth0 down

Step 3. Now enter the new mac address as below:

$ sudo ip link set dev eth0 address "enter new mac address here."

Step 4.  Now bring up the interface again:

$ sudo ip link set dev eth0 up

That’s all configuring the new mac address; you should see the new mac address:

$ ip addr

The output of the above command should show you the new mac address. Macchanger can also be used for changing the mac address from the command line.

iii) Enable and disable interfaces.

Besides ifup and ifdown tools, the ifconfig command can also be used to bring up and bring down an interface.

a) To bring down an interface:

$ ifconfig enp0s3 down

b) To bring up an interface:

$ ifconfig enp0s3 up

iv) Remove an IP address from a network interface.

To delete an IP from the network interface, use the below command:

$ sudo ip addr del 'your IP address' dev  enp0s3

Replace ‘your IP address’ with your IP address, e.g., the following command will delete the IP 192.168.2.2

$ sudo ip addr del 192.168.2.2/16 dev  enp0s3

If you have multiple IP addresses for an interface, you can delete all as shown below:

$ sudo ip addr flush dev  enp0s3

v) Set the Default Gateway

The route or ip command can be used to set a Default Gateway:

$ sudo route add default gw  10.0.2.20

or

$ sudo ip route add default via 10.0.2.20 dev enp0s3

This guide has seen how we can modify and configure various network settings in a Debian 10 OS. If you like this guide, please share it with others.

]]>
Automatically Build Docker Images in Debian 10 (Buster) https://linuxhint.com/automatically-build-docker-images-in-debian-10-buster/ Mon, 25 Jan 2021 18:10:41 +0000 https://linuxhint.com/?p=87633

Docker is an on-demand technology these days as many big companies are using it to reduce their workloads. It is used for building, packaging, and deploying applications on top of container technology. Docker can run a high resource utilization application with minimum resource usage. The hypervisor-based virtualization requires lots of resources by installing an entire operating system, whereas Docker uses very lightweight and scalable containers to run applications.

Docker can be installed on Linux, Mac, and Windows. Although It runs natively on Linux, it requires Hyper-V to be enabled on Windows.

Docker also has a Docker Hub, a cloud-based service where we can find images from verified publishers, and we can also publish and share our own custom images.  Once we have pulled an image from Docker Hub, we can create numerous containers from the very same image.

Features of Docker:

  1. It is open-source software.
  2. Provides Platform as a Service for running application in a virtual environment.
  3. It is very easy to understand and use the Docker technology.
  4. Docker applications can be easily moved and run on any system with Docker installed on it.
  5. Migration of docker containers is very fast from cloud environment to localhost and vice versa.

Docker can read and execute the instructions inside the Dockerfile and automatically build the specified image. This guide will see how we can automatically build a docker image using a Dockerfile on the Debian 10 (Buster) operating system. We will deploy the Nginx web server and create a custom Docker image.

Prerequisites:

  1. Access to “sudo” privileges.
  2. Basic Knowledge of Docker commands.

Before we start our journey, let’s quickly review some important concepts and requirements which are necessary to understand this guide. The first thing is that you should have Docker installed on your system. If you have not already, you can follow this guide to install docker. You can also use the official guide available on the Docker website for installing Docker on Debian 10.

  1. Dockerfile: This file describes the whole configuration we want to have in our  Docker container. It is a set of instructions that defines how to build an image.
  2. Docker Image: It is actually the template image we can use to build our custom container. We can say a docker image is an immutable file or a read-only image.
  3. Docker Container: In very simple words, a Docker container is an instance of our docker image. We can say the Docker image is a base image, and we create a custom container on the top of a Docker image by adding a writable layer on this image.  We can use a single Docker image to create multiple Docker containers.

I hope this review is enough for us to get started with Docker. So let’s dive in to see how to build images using Dockerfile automatically.

Step 1: The very first step in building an image starts with a docker file. So let’s first create a working directory, and inside it, we will make a Dockerfile.

$ mkdir mydock1 #  This creates a new directory.

$ nano Dockerfile # This is our dockerfile.

We can use any text editor besides nano like vi or vim.

Step 2. Add the following content to the Dockerfile and save it.

FROM ubuntu

MAINTAINER linuxhint

RUN apt-get update \

    && apt-get install -y nginx \

    && apt-get clean \

    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \

    && echo "daemon off;" >> /etc/nginx/nginx.conf

EXPOSE 80

CMD service nginx start

Step 3. Now, as we have our Dockerfile ready, it’s time to build The image. Just use the following command:

$ sudo docker build -t webserver-image:v1 .

Syntax:

sudo docker build -t name:tag /path/to/directory/of/dockerfile

Note: Always run the docker command with root user or “sudo” privileges to avoid the error: “Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker”

In the above command, the webserver-image is the name of our docker image. You can use your custom name here. V1 is the tag for our image.

If everything goes right, we should see the following output:

Sending build context to Docker daemon  2.048kB

Step 1/5 : FROM ubuntu

—> f643c72bc252

Step 2/5 : MAINTAINER linuxhint

—> Using cache

—> 1edea6faff0d

Step 3/5 : RUN apt-get update     && apt-get install -y nginx     && apt-get clean     && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*     && echo “daemon off;” >> /etc/nginx/nginx.conf

—> Using cache

—> 81398a98cf92

Step 4/5 : EXPOSE 80

—> Using cache

—> 2f49ffec5ca2

Step 5/5 : CMD service nginx start

—> Using cache

—> 855796a41bd6

Successfully built 855796a41bd6

Successfully tagged webserver-image:v1


Step 4. When we have a number of images, we can use the below command to look for a specific image:

$ sudo docker images

Step 5. Now we will run our docker image to see if it is working as expected:

$ sudo docker run -d -p 80:80 webserver-image:v1

After a successful run, it will generate a long id as shown below:

Step 6. If everything goes right, we should be able to see our web page running on our nginx web browser inside the docker. Run the below command to check it:

$ curl 'ip_address'

Please keep in mind that the IP address we are using here is the docker container’s IP address installed on our host operating system. To exactly know the ip address required here, run the following command on the host:

$ ip a | grep ^docker

The above command will contain the IP address which we have to use here.

The above curl command will display the index.html content of the nginx web server.

Another simple and straight forward way is to pass the docker as the curl argument, as  shown below:

Step 7. If you want, you can check which port and processes are running inside our docker container. Run the below command:

$ sudo docker ps

This completes our guide on automatically building Docker images on Debian 10 (Buster). We have seen how we can construct Docker images from Dockerfile instead of manually editing each image.

Although this guide is performed on Debian 10, it should also run on other Debian-based distros like Ubuntu, Linux mint, etc. Please do not forget to share this guide with others. Also, subscribe to our blog to get the latest update and HowTos on Linux.

]]>
Difference Between ARM64, ARMel, and ARMhf https://linuxhint.com/about-arm64-armel-armhf/ Mon, 25 Jan 2021 17:56:09 +0000 https://linuxhint.com/?p=87640

Most of us, while looking to buy a new smartphone, tablet, or any electronics gadget we see the term “ARM vXXX” processor in the specifications list. But we hardly bother to know what is an ARM processor. So in this guide, we will explore in brief ARM processors.

What is ARM anyway?

ARM or Advanced RISC Machines or Acorn RISC Machine (previous name) is one of the world’s most used processor cores. The ARM processor became the first commercial RISC processor in 1985. The first release was a 26 bit RISC machine. With its second release in 1987, the ARM version 2 introduced the co-processor feature. Over time the arm processors have evolved very much. The ARM corporation provides paid licenses to anyone who wants to manufacture CPUs or SOC products based on their architecture. ARM Holdings, based in Cambridge, UK, is responsible for this business in and out. Apple, Qualcomm, Texas Instruments, Nvidia, Samsung, etc., are some of the ARM family’s notable consumers.

The ARM processors are mostly used in mobile devices and embedded systems. They are small in size and have low power consumption, but at the same time, they provide high performance. The point of consideration is the design issue, as the software designed for ARM cannot run on non-ARM devices. It is just like two people with different languages cannot understand what the other is speaking.

Features of ARM Processor

  1. Based on RISC  or Reduced Instruction Set Computing.
  2. Fixed size and uniform instruction set.
  3. Multiple stage pipeline support for instruction.
  4. Supports wide frequency range.
  5. Execution of Java byte-code.
  6. Optimized for battery usage in mobile devices.

In a broad sense, the ARM architecture has three types of profiles:

A-profile or Application profile

R-profile or Real-time profile

M-profile or Micro-controller profile

Why is ARM is used by Tech Giants

For a long time, ARM is considered as the processor for mobile devices, with  x86/x64 as the target processor for desktops and servers. But with the evolution of technologies, ARM processors are being used for tablets. For e.g., Windows 10 earlier can only be run on  x86 and x64 based processor, but recent Windows 10 desktop can run on processors that are based on ARM64 architecture. Microsoft has assured the application compatibility for x86 and x64 based applications to run smoothly on the ARM64 based PCs. Although ARM32 and ARM64 based applications will directly execute, the x86 based application will require emulation to run.

Some windows version like Windows 8  requires x86 or x64 processor, whereas Windows RT needs ARM processor. Although x86/x64 are very fast as compared to the ARM processor, they consume significant energy. Therefore they are best suited for servers and desktop computers. At the same time, the ARM processor is relatively slow but requires low energy to run. This makes them more suitable for mobile devices running Android, IOS, etc.

Apple has announced to move its MAC series from Intel to  SoC and SiP processors, which are based on ARM architecture. According to Apple, with ARM processors, they will deliver performance combined with long battery power. Apple Silicon chips are the first Apple-designed Arm-based chip to be used in recent MacBook Air, MacBook Pro, and Mac mini.

The  Three Debian ARM ports: Debian/armel, Debian/armhf, and Debian/arm64

Debian/armhf is an acronym for “arm hard float,” representing a port on Debian.  The Debian armhf port was started to benefit the floating-point unit (FPU) on modern 32 bit ARM boards.

For critical accuracy requirements in computing and digital signal processing (DSP) based applications, floating-point is specifically suited. An ARMv7 CPU  with version 3 of the ARM vector floating-point specification (VFPv3) is the minimum requirement for Debian armhf port.

It is primarily used for mobile devices (smartphones, tablets) and embedded devices.

Various platforms are known to supported by Debian/armhf:

  1. Freescale MX53 Quick Start Board: The i.MX53 Quick Start Board has a 1 GHz Arm Cortex-A8 Processor. It is an open-source platform for development.
  2. NVIDIA Jetson TK1: It is a developer board with a 32-bit ARM Cortex-A15 CPU.
  3. SolidRun Cubox-i4Pro: The Cubox-i series is a tiny compute platform. Cubox-i4Pro features an ARM Cortex A9 processor.

Other supported platforms include Wandboard, Seagate Personal Cloud and Seagate NAS, SolidRun Cubox-i2eX tec. The EfikaMX platform was earlier supported till Debian 7, but from Debian 8, the support is abandoned.

Debian/armel or ARM EABI or Embedded ABI port on Debian was aimed at older 32 bit ARM processors. It does not have a hardware floating-point unit (FPU) support. ARM EABI or armel is supposed to work with ARM architecture versions 4T, 5T, and above, but with Debian 10 (buster) release, the ARM4T support is removed.

According to Oracle, the armel to armhf is in progress, so there may be some incompatibilities between them. To check whether your system is running armhf or armel, run the below command on your Linux terminal:

$ readelf -A /proc/self/exe | grep Tag_ABI_VFP_args

If the above command returns a Tag_ABI_VFP_args tag, then it is an armhf system, whereas a blank output shows that it is an armel system. For e.g., a raspberry distribution will return a Tag_ABI_VFP_args: VFP registers tag as it is an armhf distribution. On the other hand, a  soft-float Debian Wheezy distribution will give a blank output, indicating it is an armel distro.

The following list contains the various platforms supported by Debian/armel:

  1. Kirkwood and Orion5x SoC from Marvell with an ARM CPU.
  2. Versatile platform with QEMU emulator.

Debian/arm64 targets  64-bit ARM processors, which requires minimum ARMv8 architecture. The 64-bit processing provides an enhanced computing capability. This processing enhancement is achieved with an increase in memory addressing capacity in 64-bit architecture.  Arm64 hardware was first launched for iPhone 5 in the year 2013. The gnu name for ARM64 is aarch64-linux-gnu. The good thing with ARM64 is that it is compatible with its 32-bit predecessor. This helps in running the ARMv7 binaries or software without any modification on ARMv8 architecture.

Debian released ARM64 port for the first time in it’s Debian 8 (Jessie) operating system. The list of various platforms supported by Debian/ARM is given below:

  1. Applied Micro (APM) Mustang/X-Gene: It is the first known platform with ARMv8 architecture with an 8-core CPU.
  2. ARM Juno Development Platform: According to ARM, Juno Arm Development Platformis an open and vendor-neutral Armv8 development with a 6-core  ARMv8-A CPU.

Example of devices using ARM64 architecture includes Raspberry Pi 2,  Raspberry Pi 3, Microsoft HoloLens 2, DragonBoard, several IoT devices, modern laptops and desktops, smartphones, etc

Checking the processor type of your board.

To check the processor type on a Ubuntu machine, just use the following command:

$ dpkg –print-architecture

For a detailed list of the various feature of your CPU, use the following command:

$ cat /proc/cpuinfo[//c]

Another command that you can use to see the processor architecture of your system is given below:

[cc lang="bash" width="100%" height="100%" escaped="true" theme="blackboard"]
$ uname -a
]]>
How to Configure LDAP Client in Debian 10 https://linuxhint.com/configure-ldap-client-debian/ Sun, 24 Jan 2021 15:33:48 +0000 https://linuxhint.com/?p=87306 LDAP is an acronym for Lightweight Directory Access Protocol. LDAP allows users to store the usernames and passwords of users in a single place. This place is then used by multiple services for validating the users claiming these services. To use a service, you always need to have a client-end program that can help you to access that service. This article shows you how to install and configure the LDAP client on your Debian 10 system.

Method of Configuring the LDAP Client in Debian 10

To configure the LDAP client on a Debian 10 machine, perform the following fifteen steps. The configurations may vary according to your unique requirements and usage of the LDAP client. The following steps will guide you through some of the more generic LDAP client configurations.

Step 1: Install LDAP Client and Required Packages

First, install the LDAP client and all the packages necessary for LDAP to work properly in Debian 10 by issuing the command below:

sudo apt install libnss-ldap libpam-ldap ldap-utils

As soon as this command starts its execution, you will be able to see an interactive prompt, in which you can perform the various LDAP configurations explained in the following steps.

Step 2: Configure URI for LDAP Server

Next, set up the URI for your LDAP server. The server format is also shown in the following image. Then, press the Enter key to proceed to the next configuration.

Step 3: Set Up Distinct Name for LDAP Search Base

Now, you will set up a distinct name for the LDAP search base. An example is shown in the image below. Then, press the Enter key to go to the next screen.

Step 4: Choose Desired LDAP Protocol Version

There are different LDAP protocol versions available to use; however, it is always recommended to use the latest available version, which, in this case, is version 3. After selecting this version, press the Enter key to confirm your choice, as shown in the following image:

Step 5: Select LDAP Account for Root

Now, specify an account that will be used as the LDAP root user account, after which you will press the Enter key.

Step 6: Set Up Password for LDAP Root Account

Once the LDAP root account has been selected, you will need to set up a password for this account. Type in a password of your choice and then press the Enter key to go to the next screen.

Step 7: Remove LDAP Entries from Configuration File

For the basic LDAP services to function properly, it is recommended to remove the default LDAP entries from the configuration file. This can be done simply by pressing the Enter key or the OK button in the prompt, as shown in the image below:

Step 8: Allow LDAP Admin Account to Behave Like Local Root

Now, allow the LDAP admin account to behave like a local root account by selecting the Yes option from the dialogue box, as shown in the following image:

Step 9: Disable Login for LDAP Database

You can disable the login for the LDAP database by selecting the No option from the dialogue box, as shown in the image below. This will remove the need for authentication at the time of retrieving the LDAP entries.

Step 10: Enter Name of LDAP Administrative Account

Now, enter the name of the LDAP root account that you set up earlier. After that, press the Enter key to continue.

Step 11: Enter Password for LDAP Root Account or Administrative Account

Finally, enter the password for the LDAP root account or administrative account that you set up in Step 6, then press the Enter key, as shown in the image below:

After doing this, the command that you executed in Step 1 will finish its execution while rendering the following messages in your Debian 10 terminal:

Step 12: Update PAM Configurations

Next, configure your Debian 10 system to use LDAP for authentication. To do so, update the PAM configurations by running the following command:

sudo pam-auth-update

This command will display a dialogue box on your screen from which you can select any desired profiles that you want to be enabled. It is recommended to go with the default profile. Then, to continue, press the Enter key.

Step 13: Allow Automatic Creation of User’s Home Directory

You can also choose to allow the automatic creation of the user’s Home directory. To do so, you will edit the Common Session PAM file. This file can be accessed by using the following command:

sudo nano /etc/pam.d/common-session

When this file opens with the nano editor, enter the following line of code at the end of this file:

session required pam_mkhomedir.so skel=/etc/skel umask=077

After adding this line, press Ctrl + X to save your file and exit the nano editor.

Step 14: Restart Name Service Cache Daemon (nscd)

Restart the name service cache daemon (nscd) so that it can read the new configurations. The ncsd can be restarted with the following command:

sudo systemctl restart nscd

Restarting this service will not display any messages in the terminal.

Step 15: Enable Name Service Cache Daemon (nscd)

Finally, re-enable the name service cache daemon (nscd) with the command below:

sudo systemctl enable nscd

This command will display the following messages in the terminal upon successful execution:

This step brings us to the end of the LDAP client configurations in a Debian 10 system.

Method of Removing LDAP Client from Debian 10

If you no longer feel like using the LDAP client for Debian 10, you can conveniently remove it, as well as its configuration files, with the command below:

sudo apt-get purge libnss-ldap libpam-ldap ldap-utils

When this process is completed, the terminal will show the following messages:

Finally, to remove any extra packages that were installed with the LDAP client, issue the following command:

sudo apt-get autoremove

This command will remove all the packages that are no longer needed after removing the LDAP client from Debian 10.

Conclusion

This article explained how to configure the LDAP client on a Debian 10 system. These configurations are extremely easy to perform and will not take more than 10 minutes to do. Finally, we also showed you how to uninstall the LDAP client from your Debian 10 machine.

]]>
How to Install and Configure NIS Server on Debian 10? https://linuxhint.com/install-nis-server-debian-10/ Sun, 24 Jan 2021 05:01:24 +0000 https://linuxhint.com/?p=87252 NIS stands for Network Information Service, and it is used extensively for sharing configuration data about different systems across the whole network. In today’s article, we will be talking about the methods of installing and configuring this server on a Debian 10 system.

Method of Installing the NIS Server on Debian 10:

For installing the NIS server on a Debian 10 machine, you will have to perform three basic steps:

Step # 1: Update your Debian 10 System:

First, you have to update your system with the following command:

sudo apt-get update

After successfully updating your system, you will receive the messages shown in the image below:

Step # 2: Install the NIS Server on your Debian 10 System:

Now, we can install the NIS server with the following command:

sudo apt-get –y install nis

Step # 3: Set up the Domain Name for your NIS Server on Debian 10:

During the NIS server’s installation, you will be asked to set up the domain name for it. You can have any name of your choice, or you can either go with the default one and press the Enter key as we did.

After setting up the domain name for your NIS server, you will notice that the installation will finish within a few seconds while displaying the messages shown in the image below on the terminal:

Method of Configuring the NIS Server on Debian 10:

After installing the NIS server on Debian 10, we can now go on with its configuration steps as follows:

Step # 1: Start the “rpcbind” Service on Debian 10:

First, we need to start the “rpcbind” service on Debian 10 with the command shown below:

sudo systemctl start rpcbind

Step # 2: Check the Status of the “rpcbind” Service on Debian 10:

Now, we will check whether the “rpcbind” service has been successfully started or not by running the following command:

sudo systemctl status rpcbind

You can easily see the status of the “rpcbind” service on our Debian 10 system highlighted in the image below:

Step # 3: Start the “ypserv” Service on Debian 10:

After that, we will start the “ypserv” service on Debian 10 with the following command:

sudo systemctl start ypserv

Step # 4: Check the Status of the “ypserv” Service on Debian 10:

Now, we will check whether the “ypserv” service has been successfully started or not by running the command shown below:

sudo systemctl status ypserv

You can easily see the status of the “ypserv” service on our Debian 10 system highlighted in the following image:

Step # 5: Set NIS as the Master Server on Debian 10:

Now we will set the NIS as the master server on Debian 10. For that, we will access the /etc/default/nis file with the command shown below:

sudo nano /etc/default/nis

This file is shown in the following image:

We will then assign the value “master” to the “NISSERVER” variable, as highlighted in the image shown below. After that, we can save and close our file.

Step # 6: Set up the Allowable Access IP Range on Debian 10:

Now, we will set up the IP range to allow access to our NIS server. For that, we will access the /etc/ypserv.securenets file with the following command:

sudo nano /etc/ypserv.securenets

This file is shown in the image below:

Now, we will comment out the line shown in the following image:

Finally, we will add the allowable IP range to the end of this file, as shown in the image below. After that, we can save and close our file.

Step # 7: Add an IP Address for your NIS Server on Debian 10:

Now, we can add any desired IP address for our NIS server. For that, we have to access the /etc/hosts file with the command shown below:

sudo nano /etc/hosts

We need to locate our NIS server’s name in this file and then assign any desired IP address or even go with the default one as highlighted in the following image. After that, we can save and close this file.

Step # 8: Restart the NIS Server on Debian 10:

After making all these configurations, we will restart the NIS server with the following command:

sudo systemctl restart nis

Step # 9: Update the NIS Database on Debian 10:

Finally, we will update the NIS database with the command shown below:

sudo /usr/lib/yp/ypinit –m

At this point, we can add any hosts to this database that will be running the NIS servers. Once you have added the hostnames, you can press Ctrl+D.

After that, you have to enter “y” and then press the Enter key as highlighted in the following image:

Once the NIS database is updated, you will get a confirmation message that the selected system has been set up as a NIS master server, as highlighted in the image shown below:

Method of Removing the NIS Server from Debian 10:

We can also remove the NIS server from our Debian 10 system any time by going through the following two steps:

Step # 1: Remove the NIS Server along with its Configuration Files:

First, we will run the command shown below to remove the NIS server and its configuration files:

sudo apt-get purge nis

Step# 2: Remove all the Additional Packages and Dependencies:

Finally, we will also remove all the unused packages and dependencies with the following command:

sudo apt-get autoremove

Conclusion:

This article focused on the methods of installing and configuring the NIS server on Debian 10. The methods might look lengthy, but it only took us a few minutes to complete these configurations. Finally, we wrapped up this article with the removal method of NIS from Debian 10.

]]>
How to Install Swift in Debian 10 https://linuxhint.com/install-swift-debian/ Sun, 24 Jan 2021 01:23:21 +0000 https://linuxhint.com/?p=87295 Swift is a famous language that was developed by Apple to create software applications. Swift is an open-source language that is used as a fast and interactive programming language to develop various software for all platforms and servers. Writing a Swift code is interactive since the syntax is quite concise. Swift also contains multiple features that are useful for developers. The code written in Swift is safe for designing and extremely fast, as well. This article shows you how to install Swift on a Debian 10 server.

This tutorial will be of great help to all Debian users who wish to install Swift on their computers. We will be using Debian 10, but even if you do not have the latest version of Debian installed on your system, feel free to follow the same procedure on your computer.

Prerequisites

  • Debian 10
  • A sudo user

Installing Swift in Debian 10

To install Swift in Debian, open the terminal using the Ctrl + Alt + T shortcut, then follow the

steps listed below:

Step 1: Updating Packages

To update your packages, run the following command in the terminal window:

$ sudo apt update

The above command will begin to update the packages of your Debian server.

Step 2: Installing Required Dependencies

To install all the dependencies required to install Swift on a Debian 10 server, issue the following command in the terminal window:

$ sudo apt-get install libncurses5 clang libcurl4 libpython2.7 libpython2.7-dev

After some time, the system will prompt you to ask you for permission to continue. Press Y to confirm and then press the Enter key to continue.

Using this method, users can install and update all of the required dependencies on their servers.

Step 3: Installing Swift

The next step is to install Swift on the Debian server. Because there is no pre-defined method for installing Swift on a Debian system, we use the following link to install Swift on our Ubuntu 18.04 system. The latest version available at the time of writing this article is 5.1.3. If there is another version available when you are implementing this method, then feel free to opt for that version by using the following command to get the latest archive version of Swift:

$ wget https://swift.org/builds/swift-5.1.3-release/ubuntu1804/swift-5.1.3-RELEASE/swift-5.1.3-RELEASE-ubuntu18.04.tar.gz

After that, the download will be completed, and an archive file will be saved.

Once the download of the Swift package has been completed, extract this newly downloaded archive file. Execute the following command in the terminal window:

$ tar xzf swift-5.1.3-RELEASE-ubuntu18.04.tar.gz

Next, move this newly extracted folder to the opt directory using the following command:

$ sudo mv swift-5.1.3-RELEASE-ubuntu18.04 /opt/swift/

Step 4: Configuring PATH Environment Variable

You must add the Swift installation path into the PATH environment variable of your system. To do so, issue the following command:

$ echo "export PATH=/opt/swift/usr/bin:$PATH" >> ~/.bashrc

After that, issue the following:

$ source  ~/.bashrc

This marks an end to the process of installing and configuring Swift on the Debian 10 server.

Step 5: Verifying Installation Process

To verify the installation of Swift, issue the following command in the terminal window:

$ swift -version

The output will display the version of Swift installed on your server. This output indicates a successful installation process.

Conclusion

This article showed you a step-by-step method for installing Swift on a Debian 10 server. After installing Swift, you can also verify the installation using the last step in this tutorial.

]]>
How to Use Unison to Synchronize Files Between Servers https://linuxhint.com/unison-file-synchronization-between-two-servers/ Sat, 23 Jan 2021 03:16:28 +0000 https://linuxhint.com/?p=87006 This tutorial will show you how to set up and use the Unison File synchronization tool on Debian systems. Using Unison, you can sync files between two different disks or directories in the same system or two other systems over the network.

What is Unison?

The Unison technology developed by Benjamin C Pierce under the GPL License allows users to synchronize two single file instances on the same system but different disks or two other systems.

Unison allows you to keep an updated and identical version of the same file or directory. It’s utilizable in a wide variety of contexts, such as SSH, allowing secure transfer of data between devices or directories.

The Unison tool is cross-platform, allowing users to sync files and directories between systems running the same or different operating systems. For example, you can sync files from a Linux system to a BSD system. Because of its security features, Unison syncs files and directories and applies ownership and permissions rights on both systems.

The Unison tool is developed with security in mind and can survive failures where interruptions happen between syncing points. If Unison detects file and directory conflicts, it reports the existing conflicts and allows the users to select which version of the files should apply.

Unison can work with—or supports—slow networks, making it a very efficient tool for bandwidth usage. It only synchronizes parts and directories that have changed, thus preventing heavy load and updating the sync process very easily and quickly.

Despite its primary usage context, Unison is a powerful tool that can be modified to create a wide range of use cases.

This tutorial will discuss how to install and setup the Unison File Synchronization System on Debian 10.

How to Install Unison on Debian 10

Unison is a popular tool; because of that, it’s available in official repositories of major Linux distributions.

To install the command-line version of Unison on Debian, start updating the system:

sudo apt-get update && sudo apt-get upgrade

Next, use the simple apt to command to install the tool.

sudo apt-get install unison -y

If you have a desktop environment installed on your system and prefer a GUI version of the tool, install unison-gtk using the command:

sudo apt-get install unison-gtk

NOTE: Ensure you install Unison on both versions of the systems you wish to sync files between them. For compatibility and to minimize the chances of errors, it is better to have the same version of Unison in both systems.

How to Sync Files with Unison

Unison provides us with ways to sync files and directories between local machines and remote machines using direct socket connections and SSH. Since we are syncing between two Debian servers, we will skip local machine synchronization.

Unison Remote and Remote Sync via SSH

To synchronize files and directories between remote machines, you will need to have Unison installed in both systems, have SSH access to both the systems and their IP addresses.

You can also use your local machine as one server and the remote device as the other server.

  • 192.168.0.200 – server1
  • 192.168.0.201 – server2

The first step is to create a private and public key on the remote server1.

ssh-keygen -t rsa

Generating public/private rsa key pair.

Enter file in which to save the key (/home/csalem/.ssh/id_rsa):

Created directory '/home/csalem/.ssh'.

Enter passphrase (empty for no passphrase):

Enter the same passphrase again:

Your identification has been saved in /home/csalem/.ssh/id_rsa.

Your public key has been saved in /home/csalem/.ssh/id_rsa.pub.

The key fingerprint is:

SHA256:4p5YuEBEa5lrINzqPgwHRVhSS0TNlIIl70A0q2MFcS8 csalem@Debian-PC

The key’s random art image is:

+---[RSA 2048]----+

|+/@=..           |

|=*O==            |

|++OE .           |

|+*o..            |

|o+=   . S        |

|++.  o .         |

|oo. . o          |

|.o . = .         |

| .. o o          |

+----[SHA256]-----+

Quickly skip over the key generating process and save the file. Please do not add a passphrase because it can hinder unmonitored sync between the servers.

Next, copy the key from server1 to server2 using the command:

ssh-copy-id 192.168.0.201

Now that you have SSH setup on both systems, you can start Unison to sync files and directories.

Let’s test the use of Unison on both servers by creating the directory we will sync on server1:

mkdir -p /dir1

On server2, create a directory as above

mkdir -p /dir2

As mentioned, Unison respects user permissions. Therefore, it is best to change permissions and ownership in both directories to ensure both directories have read and write privileges.

Next, add all the data you wish to synchronize between the servers in dir1. For example, add a few zip files.

sudo mv ~/Documents.zip /dir1

Having the files, we want to sync in the right directory, run unison command to sync from server one as:

unison /dir1 ssh://192.168.0.201//dir2

On the first Unison launch, you will receive a warning that the syncing process can take a while. If you have large files in the directories, this can take a while, but since we are only using it for testing purposes, it should be relatively quick.

Press Enter to start the sync process. Once the sync process completes, go to server2, navigate to dir2, and list the contents of the directory as:

cd /dir2 && ls -la

-rw-r--r-- 1 root root  436 Jan  5 12:57 Documents.zip

Modifying Unison Configuration

In most cases, we do not want to interactively sync files between these servers as the process is repetitive and inefficient. We can edit the Unison configuration file to allow automatic sync files.

Use the command below to edit the default configuration file:

sudo vi ~/.unison/default.prf

In the file, add the following lines:

auto=true

batch=true

The above lines disable prompts when syncing files, automating the process.

Setting up Unison Cronjob

One sure thing is that programmers are very averse to doing things manually, especially when it’s possible to automate, which is the case here. We can set up a cronjob for Unison to be performing sync automatically.

In server1, create a simple bash script to run unison command as:

sudo touch /usr/bin/unisoncron && sudo vi /usr/bin/unisoncron

In the file, start with a shebang and add the unison sync command:

#!/bin/bash/

unison /dir1 ssh://192.168.0.201//dir2

As usual, make the script execute permissions:

sudo chmod 755 /usr/bin/unisoncron

Now edit your cronjob file with crontab:

sudo crontab -e

If this is your first time editing crontab—I hope it’s not—choose your editor and enter the following line to sync with Unison every 1 hour:

*/60 * * * * /usr/bin/unisoncron &> /dev/null

You can also set up the crontab to run at specific times of the day. You also do not need to use a script and can use a raw command in the crontab.

Conclusion

This tutorial showed you how to install and setup Unison on a Debian system for files and directories synchronization.

Although this quick guide can help you get started, you can learn more by using Unison man pages (manual pages) or the official documentation using the resource provided below:

]]>
How to Install Osquery on Debian 10 https://linuxhint.com/install-osquery-debian-10/ Thu, 21 Jan 2021 02:43:27 +0000 https://linuxhint.com/?p=87041 In this Osquery tutorial, we will start by discussing what Osquery is, how it works, how to install it on Debian, a quick introduction to SQL, and finally build a project detailing how to integrate Osquery with the ELK Stack.

To keep this tutorial concise, we will not dive deep into the “what” and “how” of the ELK stack. Instead, we’ll quickly and straightforwardly discuss how to use it with Osquery. We will also assume you have a working knowledge of SQL—the provided guide notwithstanding).

What is Osquery?

Developed by Facebook, Osquery is a cross-platform, open-source tool used to query and monitor systems using SQL based queries.

Osquery can interact with the system and gather detailed information such as memory usage, running processes, loaded kernel modules, hardware events, network connections, etc. The tool runs on all systems, including Windows, Linux, Mac, and BSD.

Using Osquery, you can create SQL queries that display information about the system and use this information to monitor and analyze the data collected.

How to Install Osquery on Debian Systems

Installing Osquery on Debian systems is very easy, and although it is not available in the main Debian repos, adding it is pretty straightforward.

Let’s look at the first method you can use to install Osquery on Debian:

The first and simplest step is to download the deb installer from the main page:

https://pkg.osquery.io/deb/osquery_4.6.0-1.linux_amd64.deb

wget https://pkg.osquery.io/deb/osquery_4.6.0-1.linux_amd64.deb
sudo dpkg -i osquery_4.6.0-1.linux_amd64.deb

We recommend the above method as the deb packages have very few dependencies on most Debian distributions. However, if you wish to add to apt, use the next method.

Enter the following commands to install Osquery from the repositories.

export OSQUERY_KEY=1484120AC4E9F8A1A577AEEE97A80C63C9D8B80B
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys $OSQUERY_KEY
sudo add-apt-repository 'deb [arch=amd64] https://pkg.osquery.io/deb deb main'
sudo apt-get update
sudo apt-get install osquery

How to Use Osquery on Debian 10

Before diving deep into building automated scripts and working with the ELK stack, let us discuss some simple Osquery usage on the local system.

Osquery has three main components you can use to interact with the API.

Osquery: The first component is osqueryi, an interactive shell session. The osqueryi mode is entirely standalone and does not require interaction with the Osquery—Osquery daemon. Using the osqueryi mode, you can interactively execute SQL queries and explore the current system similar to a SQL shell.

NOTE: Osquery respects user spaces, and if you run the shell as a regular user mode, you will not have access to privileged tables.

Osqueryd: The other component is osqueryd, the Osquery daemon used to schedule queries and record state changes in the background. The daemon works by aggregating query results executed over a specific time frame and generates logs used to compare every query’s state changes.

Osqueryctl: The third component is Osqueryctl, a helper script used to test deployment configuration. You can also use it as an Osquery service manager, allowing you to start and stop the service.

Out of the box, Osquery is nothing more than a simple tool to query information about the system. However, when you combine the queries to build well-sorted and aggregated data, it becomes more than a query tool.

To get rollin’, let’s start with the basics to understand how it works:

The first step is to get help with the command:

sudo osqueryd --help

This command will display the Osquery daemon help, with a list of arguments you can use in the shell.

The next, and the easiest way to interact with Osquery, is to use the osqueryi session. For example, if you execute the command osqueryi without an argument, you will drop into an SQL-like shell:

sudo osqueryi

Inside the osqueryi shell, you can execute commands and SQL syntax to select specific information about the system.

To view the help mode inside the osqueryi shell, use the command:

osquery > .help

Executing this command should display help regarding the Osquery session.

Since Osquery is a relational database mapper for your system, it has a list of tables you can use to select information from using SQLite Queries.

NOTE: Osquery queries are SQLite-based. You can refer to its documentation if Osquery does not provide enough information:

https://www.sqlite.org/index.html

Inside the osqueryi shell, use the command:

osquery > .tables

This command lists the available tables containing system information.

From there, you can select information from the available schemas. For example, view the information about DNS resolvers.

SELECT * FROM dns_resolvers;

Depending on the schema you query, you will get a boatload of information and may need to use a combination of SQL queries to make sense of it.

You can learn more about Osquery tables and schemas from the following resource:

https://osquery.io/schema/4.6.0/

A Basic SQL Guide

Osquery works by using SQLite syntax queries to gather information about a system. I have no idea why Facebook chose this route, but it works.

This simple tutorial will discuss SQLite basics to explain how you can use it to interact with Osquery.

NOTE: This is in no way meant to be a guide for SQL or related languages. For more language-specific guides, refer to the primary documentation.

Selecting specific entries from a table

Using basic SQLite syntax, we can select specific information from a table using the SELECT statement as shown:

SELECT pid, name, path FROM processes;

Adding SQL functions

Osquery also supports SQL functions, allowing you to perform various actions with data gathered from the queries.

For example, the count function can allow you to view the number of users in your system.

SELECT COUNT(*) FROM users;

This command will return the total number of users in the system.

The ability for Osquery to use SQL syntax is a huge advantage that can help you build complex datasets that can give you a more in-depth analysis of a system. It also creates a bridge that SQL developers using engines such as PostgreSQL, MySQL, and others can use to adapt with ease.

https://osquery.readthedocs.io/en/stable/introduction/sql/

A Fun, Side Project

When you explore Osquery further and experiment with it, you will discover it’s a comprehensive and powerful tool that makes it easy to create projects specifically tuned to monitor your systems.

Because of this tutorial’s scope, and to avoid confusing beginners, we will not delve into complex projects. That mentioned, here are some tools you can build using Osquery:

  • Collect logs with Logstash
  • Build a system monitor dashboard with Elasticsearch, Logstash, and Kibana.
  • Build Osquery fleet with Kolide

https://osquery.readthedocs.io/en/stable/deployment/log-aggregation/
https://www.elastic.co/guide/en/beats/filebeat/7.10/filebeat-module-osquery.html
https://github.com/fleetdm/fleet

Conclusion

In this tutorial, we looked at the basics of Osquery, including how to use it to collect system information.

Although not comprehensive, this guide purposed to provide you with a quick and straightforward introduction to Osquery; by no means was it a reference guide.

Feel free to use other resources to gain a deeper understanding of the various concepts we’ve discussed in this tutorial.

]]>
How to Install R on Debian 10 https://linuxhint.com/install-r-debian-10/ Wed, 20 Jan 2021 18:06:20 +0000 https://linuxhint.com/?p=86984 R programming language is free and an open-source environment that is specifically used in graphical representation and solving statistical computing problems. R foundation supported this language for statisticians and data mining experts for data analysis and developing statistical applications. R language is most similar to the S language. R language file you can save with extensions (.r, .rdata, .rds, .rda).

This article will give you a complete description of the R programming language installation on the Debian 10 system.

Prerequisites

You should have the following prerequisites for R language installation:

  • Your system should have at least 1G or less than 1GB of RAM.  If you don’t have installed the required RAM, then use a swap file option.
  • Ensure that you must log in as a root user or should have ‘sudo’ privileges.

Open the terminal command line window. To do this, click the top section ‘Activities’ and type the ‘Terminal’ keyword in the search bar. Click on the ‘Terminal’ icon as follows:

R installation on Debian 10

The installation of R is completed into the following different steps, which we are mentioned below in detail:

The R package, which installation from the Debian repository, is usually outdated. Therefore, we will install the latest stable version of R from another repository maintained by CRAN.

Step 1: Install the required packages for adding a repository

Use the following command to install all necessary packages which are required to add a new CRAN repository:

$ sudo apt install dirmngr apt-transport-https ca-certificates software-properties-common gnupg2

Step 2: Enable repository for installation

Execute the below-mentioned command to enable the CRAN repository and import the following CRAN GPG key to your system:

$ sudo apt-key adv --keyserver keys.gnupg.net --recv-key 'E19F5F87128899B192B1A2C2AD5F960A256A04AF'

$ sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/debian buster-cran35/'

Step 3: Update system packages

Update the packages by running the below-mentioned command:

$ sudo apt update

Step 4: R installation

Use the below command on the terminal to install R on your system as follows:

$ sudo apt install r-base

Now, check the R language installation on your Debian 10 system by using the below-given command:

$ R --version

You will notice that the latest stable version of R is printed on the terminal:

Install required R packages from CRAN

You can find a wide range of R packages through the CRAN, which stands for Comprehensive R Archive Network that is the main reason R language is becoming popular day by day.

Install the following package that contains the required tools for compiling or building R packages:

$ sudo apt install build-essential

To install any R package, first, you need to open the R console environment on the terminal by typing the following command with sudo or root privileges:

$ sudo -i R

Now, you can install R packages on your system. Let’s take an example. You want to install the R package ‘Stringr’ for string manipulation. For that purpose, enter the following command in the R console as follows:

> install.packages("stringr")

Installation of the ‘Stringr’ package will complete in a few seconds. After that, you will load the relevant library by using the following command:

> library(string)

Print first Program in R Console

In this program, we will create a character vector with name tutorial as follows:

> tutorial <- c("Install", "R", "on", "Debian", "10")

Now, use the following command to print this on the terminal:

> print(tutorial)

To find the length of the string, type the command as follows:

> str_length(tutorial)

The following vector length will display on the screen:

You can also install more R packages from CRAN by using the following command:

> install.package(package_name)

Conclusion

You have learned how to install R and run R programs on the Debian 10 environment. We have provided in this article how to install R packages by using a simple command from CRAN. You can easily Install any R packages and load its associative library on your system. Now, you can easily install and use R on your Debian system.

]]>
How to Install SysStat to Enable System Monitoring on Debian 10? https://linuxhint.com/install-sysstat-debian-10/ Wed, 20 Jan 2021 10:27:14 +0000 https://linuxhint.com/?p=86906 SysStat is a very useful utility for Linux based systems that are used for effectively monitoring your system. With system monitoring, you can easily figure out all the potential issues in your system, and hence, you can keenly observe the activities going on in your system. In this article, we are going to explain to you the procedure of installing SysStat to enable system monitoring on Debian 10.

Method of Installing SysStat to Enable System Monitoring on Debian 10:

For installing SysStat to enable system monitoring on Debian 10, you have to go through the first five steps listed below, whereas the sixth step represents an example use case of SysStat in Debian 10.

Step # 1: Installing SysStat on Debian 10:

The SysStat utility in Debian 10 can be installed by running the following command:

sudo apt install sysstat

As soon as the SysStat utility is successfully installed on your Debian 10 system, these messages will be displayed on the terminal:

Step # 2: Enabling System Monitoring in the SysStat File in Debian 10:

Now you need to tweak the SysStat file a little to enable system monitoring on Debian 10. This can be done by accessing the SysStat file in the manner shown below:

sudo nano /etc/default/sysstat

The default SysStat file is shown in the following image:

Now we will enable system monitoring in this file by setting the value of the variable “ENABLED” to “true” instead of “false,” as highlighted in the image shown below:

After modifying the SysStat file, we will simply exit the nano editor after saving the file.

Step # 3: Enabling the SysStat Service in Debian 10:

Now we need to re-enable the SysStat service in Debian 10 with the following command:

sudo systemctl enable sysstat

The successful execution of the above-mentioned command will display the messages shown in the image below:

Step # 4: Starting the SysStat Service in Debian 10:

Once the SysStat service is enabled on Debian 10, we need to restart it with the following command:

sudo systemctl start sysstat

The error-free execution of this command will display the messages shown in the image below:

Step # 5: Checking the Status of the SysStat Service in Debian 10:

We can also check the status of the SysStat service in Debian 10 with the following command:

sudo systemctl status sysstat

The status of the sysstat service on our Debian 10 system is shown in the image below:

Step # 6: Viewing the CPU Statistics with SysStat in Debian 10:

By now, the SysStat service will be successfully running on your Debian 10 system. We have shared a sample scenario of viewing the CPU statistics with the SysStat utility in Debian 10 over here. However, the SysStat utility can also be used for viewing other useful system statistics. The CPU statistics can be viewed by running the following command:

sar –u

The CPU statistics of our Debian 10 system are shown in the image below:

Method of Removing SysStat from Debian 10:

Whenever you want to remove the SysStat utility from your Debian 10 system along with all of its dependencies and configuration files, you can run the following command:

sudo apt-get autoremove --purge sysstat

Once all the dependencies and packages that got installed along with the SysStat utility and its configuration files will be removed successfully from your Debian 10 system, you will see these messages on your terminal:

Conclusion:

In this article, we talked about installing the SysStat utility to enable system monitoring on Debian 10. We also shared with you an example scenario of using this utility. Finally, we concluded this article by sharing with you the method of removing this utility from your Debian 10 system.

]]>
How to Setup vsftpd FTP Server on Debian 10? https://linuxhint.com/setup-vsftpd-ftp-server-on-debian10/ Wed, 20 Jan 2021 01:59:18 +0000 https://linuxhint.com/?p=86700 Vsftpd (Very Secure FTP Daemon), licensed under GNU General Public License, is an FTP protocol used to transfer files to and from a remote network. It is a secure, stable, and fast FTP server that is supported on Linux/UNIX operating systems. In this post, we will learn how to set up a vsftpd FTP server on the Debian system.

Note: The commands have been tested on the latest release of Debian i.e., Debian 10.

Setup vsftpd FTP Server on Debian 10

Follow the below steps in order to setup vsftpd server on Debian 10:

Step 1: Install VSFTPD

First, update the repository index using the below command in Terminal:

$ sudo apt update

Now, you can install vsftpd as follows:

$ sudo apt install vsftpd

The system might prompt you for a sudo password and might also prompt you with the Y/n (yes/no) option for proceeding with the installation of vsftpd. Press Y to proceed.

After the installation is finished, you can verify it using the below command:

$ vsftpd -versions

Step 2: Allow FTP in the firewall

If a firewall is running on your machine, allow ports 20 and 21 for FTP traffic. To check if a firewall is running, run the below command in Terminal:

$ sudo ufw status

If you see “active” status in the output, it means the Firewall is running on your system.

Now to allow port 20 and 21, run the below command in Terminal:

$ sudo ufw allow 20/tcp
$ sudo ufw allow 21/tcp

Now to confirm if the rules have been added, run the below command in Terminal:

$ sudo ufw status

The below output shows the Firewall has allowed the FTP ports.

Step 3: Configuring FTP Access

Now we will do some basic configurations for the FTP server. But before going for configurations, let’s make a backup of the vsftpd configuration file using the below command in Terminal:

$ sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.orig

Now edit the vsftpd configuration file as follows:

$ sudo nano /etc/vsftpd.conf

Now modify the configurations to match them as follows:

listen=YES
listen_ipv6=NO
connect_from_port_20=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
allow_writeable_chroot=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
pasv_enable=YES
pasv_min_port=40000
pasv_max_port=45000
userlist_enable=YES
userlist_file=/etc/vsftpd.userlist
userlist_deny=NO

Now save and close the vsftpd.conf configuration file.

Step 4: Add FTP user

Now, we will add a user to the allowed FTP users list. For testing purposes, we will create a new user account named “tin”, and then set its password.

To create a new FTP user, use the following command:

$ sudo adduser tin

Then set its password using the command below:

$ sudo passwd tin

Add the user to the allowed FTP users list:

$ echo "tin" | sudo tee -a /etc/vsftpd.userlist

Step 5: Restart VSFTPD service

Once you have finished the configurations, restart the vsftpd service. Run the command below to do so:

$ sudo systemctl restart vsftpd

To enable the vsftpd as a startup, run the following command in the Terminal:

$ sudo systemctl enable vsftpd

Step 6: Test FTP Access

We have configured the FTP server to allow access to only user “tin”. Now to test it, you will need an FTP client. We will use here the Filezilla as the FTP client.

You can install the Filezilla as follows:

$ sudo apt install filezilla

To launch Filezilla, either search it through the Applications list or simply execute the following command in Terminal:

$ filezilla

This will be the default view you will see when you launch the Filezilla.

Now to connect to the FTP server, we will require its IP address. You can find the IP address of your FTP server by entering the command in Terminal:

$ ip a

The below output shows the IP address of our FTP server is 192.168.72.189.

In the Filezilla window, type the IP address of the vsftpd FTP server, username, and password in their respective fields. Then, click Quick connect to connect to the vsftpd FTP server.

Once you are connected to the FTP server, try uploading and downloading the files to and from the FTP server, respectively.

Conclusion

That is all there is to it! In this post, we have covered how to setup vsftpd FTP server on Debian 10 machine. Now, you can easily access and upload/download files to and from your FTP server, respectively.

]]>