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.
For creating a simple Perl script in Debian 10, there are three main steps that you need to follow:
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:
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:
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:
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:
The output of the “whereis” command is shown in the image below:
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:
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.
You can run a Perl script by using either of the two methods listed below:
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:
You have to make the Perl script that you have just created, executable by running the following command in your terminal:
After making your Perl script executable, you can run it by executing the following command in your terminal:
Running this script will show you its output on the terminal as shown in the image below:
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:
Running this script will show you its output on the terminal as shown in the image below:
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.
]]>For accessing a remote desktop from your Debian 10 system, you will have to perform the following steps:
First, we have to update our Debian 10 system with the command shown below:
When our Debian 10 system is fully updated, we will install a remote desktop client of our choice on it.
We need to install Remmina remote desktop client on our Debian 10 system. This can be installed with the following command:
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.
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:
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:
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:
For removing Remmina remote desktop client from your Debian 10 system, you need first to run the following command in your Debian 10 terminal:
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:
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.
]]>For listing all the running services in Debian 10, you can select any of the following three methods:
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:
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:
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:
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:
You can use the “pstree” command to list down all the running services in Debian 10 in the manner shown below:
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:
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 and Ubuntu servers are considered quite similar in many respects. Let us dig deep into a comparison of the two 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.
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.
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.
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.
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.
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.
]]>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:
The following result will show on your terminal to determine if IPV6 is enabled.
Using the following three commands input, you can disable the IPV6 on your system:
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:
Now, paste the following lines in this file and save it:
Paste the below-mentioned line, if you have any specific network interface adopter such as “enp0s3”:
To verify the change settings, type the following command:
Create file in the /etc/sysctl.d directory using the following command:
Paste the following line in this file:
Save and press ‘Ctrl +X’ to exit from this window.
Now, check the effect of the changes using the following command:
Run the following command to verify the results:
As you can see in the above output, IPV6 connections have been disabled on this system.
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.
]]>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.
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.
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:
Next, extract the archive in /usr/local directory:
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
Now save the file and apply the changes by sourcing the bashrc file:
Now verify that go is installed by calling the command go:
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:
Next, install the MySQL server:
Next, launch the SQL shell and enter the commands:
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:
Navigate to gogs directory
Compile the main program
Once completed, launch the gogs binary:
This will launch the webserver and listen for incoming http connections.
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.
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.
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.
]]>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.
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:
Now extract the archive with tar command as:
Next, navigate to the extracted directory and run create a file “.ts3server_license_accepted”. Add the line “license_accepted=1
Next, launch the server using the command:
Next, note all the information printed, including usernames and passwords. These are important, and you will require them to log in.
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.
You now know how to install TeamSpeak on Debian 10 and connect to it.
]]>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:
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:
With the basics nailed down, let’s move on and discuss how we can use WeeChat to connect to IRC networks.
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:
We need to install WeeChat before we can use it on our system:
This tutorial only covers WeeChat installation on a Debian system. Check the official documentation for other installation instructions.
WeeChat is available in the official Debian repositories.
Start by updating the system repos using the command below:
Once we have the system up to date, we can install WeeChat using the command:
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:
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.
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:
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:
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:
To leave a channel or part a channel that keeps the buffer open, you can use the command:
To completely close and leave the channel, use the /close command.
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.
You can use the following commands to manage buffers and windows.
For buffer, use the command:
For windows, use the command:
For example, to split your screen into a large window, use the command:
You can remove the split by merging the windows using the command:
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:
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.
You can open a buffer to send a private message to a specific user in an IRC channel.
The general syntax is:
For example, to send a message to a linuxhint user, use the command:
If you want to establish a consistent buffer for sending private messages, you can use the /query command.
For example:
The command above will open a conversation buffer between you and the specified user.
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.
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:
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
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:
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:
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:
NOTE: You can pass a set of nicknames in case one of them.
To set a default username, use the command:
To change an already connected nickname, use the /nick command as:
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.
]]>For upgrading your Linux kernel version in Debian 10, you have to perform the following four steps:
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:
The currently installed kernel version on our Debian 10 system is Linux 4.19.0-9-amd64, as shown in the following image:
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:
When all the necessary packages on your Debian 10 system is updated, this command will finish its execution as shown in the following image:
Now we can finally attempt to upgrade our Linux kernel version in Debian 10 with the help of the command shown below:
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.
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:
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.
]]>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.
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:
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.’
For TCP, use the ‘-t’ option, along with the ‘-A’ tag.
For UDP connections, use the following command:
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:
The “n” option used with ‘t’ prevents socket statistics from resolving IP addresses to hostnames and displays the faster output, as follows:
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.
For all UDP listening connections, replace the ‘t’ option with the ‘u’ option, as follows:
You can display the process name, along with the pid of each process, using the following ss command with the ‘-ltp’ option:
The use of the ‘s’ option with the ss command displays the complete statistics, as follows:
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:
To print the IPv4 socket connections only, use the ‘-4’ option with ‘-f inet,’ as follows:
For IPV6, use the ‘-6’ option or ‘-f inet.’
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:
In the above example, we filtered all ‘established’ socket connections of TCP.
You can also filter the connection by the port number or by a specified IP address, as follows:
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.
]]>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.
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:
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:
Step 2: Install Pip
First, ensure the installation of python2 on your system by running the following command:
The installed version will be displayed on the terminal. Now, type the following command to install the pip tool for Python2:
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:
The installed version will be displayed on the terminal after running the above command.
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:
Step 2: Install pip along with all dependencies for python 3 by executing the following command:
Step 3: verify the pip installation using the following command:
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:
You can search for a package through pip, using the following command:
With pip, you can install a python package from PyPI, as follows:
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:
You can also display the package information using the following commands:
The command below allows you to remove or uninstall a package through pip3:
To uninstall the scrapy package, run the below-mentioned command:
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:
All pip commands and option will be displayed on the terminal as follows:
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.
]]>Note: We will be explaining the commands and procedure on Debian 10 (Buster) system. You should
Firstly, update the system repository index as follows:
Enter the sudo password.
Now install Apache using the below command in Terminal:
We will need to install MariaDB as a database backend for SOGo. Execute the below command to install the MariaDB server on your system:
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:
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.
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:
Now to add the SOGo repository, add the below line at the end of the file:
Now save and close the sources.list file.
Add key for SOGo repository using the following command:
After adding a new repository, you will need to update the local repository index. Use the below command to do so:
Once the update is completed, you can install SOGo as follows:
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:
To automatically start the SOGo service at boot, execute the below command in Terminal:
Now start MySQL using the below command in Terminal:
Now we will create a database and a user. Issue the following to create a database “sogo”:
Now create a user named “sogo” with the password “password”.
First, connect to the database to run subsequent commands:
Then create a database table to hold user information.
Now add an entry in the table for a user:
Now we will have to enable some of the Apache modules. Execute the below command in Terminal to do so:
After the modules are enabled, restart apache as follows:
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:
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.
Now restart SOGo service using the below command:
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:
Now find the following lines and replace 443 with 80 and yourhostname with localhost.
It should now look like this:
Then to check for any configuration errors, execute the below command in Terminal:
If you receive the following output, it means configurations are fine.
Now restart the Apache server as follows to apply the configuration changes:
Now access the following address in any web browser from the same system on which SOGO is installed:
You should now see the SOGo login page where you can log in using your admin username and password, which are ‘sim’ and ‘sim123’.
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:
When you install SOGo, some dependencies are also installed with it. To remove those dependencies too, execute the below command in Terminal:
Alternatively, if you want to uninstall SOGo along with all configuration files, execute the below command in Terminal:
Then to remove the dependencies too, execute the below command in Terminal:
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. ]]>
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.
All commands should run under administrative privileges.
Follow the following procedure to install the diaspora decentralized social media on Debian 10:
Install the required dependencies for diaspora installation such as Redis, PostgreSQL, and Nginx web server.
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:
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.
Now, change the ‘postgres’ default user password by using the following command:
Enter the new password and again re-enter the password for confirmation.
Create a new user named ‘diaspora’ who have certain privileges ‘CREATEDB’:
Type ‘exit’ on the terminal to leave the PostgreSQL shell window.
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:
Add the above user ‘diaspora’ into the sudo group by running the below-given command:
Now, this user can run all administrative sudo commands on this system.
Log in as a diaspora user on your system by executing the following command:
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:
Next, install the RVM by executing the following command:
Once the RVM installation is completed, load the script on your system by using the following command:
Now, using the rvm commands, you can install ruby packages on your system. So, use the following command to install Ruby 2.6:
Once the installation of Ruby is completed, check the installed version by executing the following command:
Download the source code of diaspora by using the following git clone command:
Navigate into the diaspora directory and copy or duplicate the database configuration ‘database.yml’ and the diaspora configuration ‘diaspora.yml’.
Open the configuration files in the most friendly nano text editor and edit them.
For database configuration:
Edit the PostgreSQL section with your username and password as follows:
Press ‘Ctrl + O’ to save changes and then press ‘Ctrl +X’ to exit from the nano.
Now, edit the ‘config/diaspora.yml’ file.
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.
After that, you need to migrate the database by executing the following command:
Combine all rails assets as follows:
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:
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:
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:
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:
Now, start all services and get status by using the following commands:
Enter the password and continue the process.
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.
To make your domain more secure, generate the SSL Letsencrypt certificate. For this purpose, install the certbot using the following command:
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.
Once you have configured all diaspora services, add your domain name to your browser’s address bar.
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.
]]>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.
here enp0s8 is any interface or device. The naming convention may vary depending upon the naming mechanism used.
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.
The above command will create a new connection named “MyCon1” on the device enp0s8. Let us see some details about this command:
To activate the connection, use the following command:
To verify the new connection, run:
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:
Now add the following lines:
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:
Now we will reload this interface by running the command ifdown followed by ifup:
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:
Now restart the networking service and again run the command ifdown and ifup as above:
To verify the above network configuration, use the following ‘ip’ command to see if the interfaces are shown with their respective ip addresses:
Note: DHCP Ip is generally good for clients, but the server usually works on a Static IP address.
Linux provides a sysctl utility to display and set the hostname as shown below:
i) Displaying the hostname:
ii) Setting the hostname
Now run the command bash exec to verify the new hostname:
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:
Now from this point, you should see your new hostname every time you open a new terminal.
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:
Go to the line containing the string “nameserver” and add the IP address of the DNS server(8.8.8.8) as shown below:
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 :
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:
Step 2. Now bring down the interface before configuring it:
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:
Now add the following lines:
Restart the networking service
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:
To check if the bind interface is created, run the following command:
or
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:
Step 2. Run the following command to get a list of all the network interfaces available on your system:
Step 3. create a new interface using the brtcl tool:
This will create a new virtual interface to link between eth0 and eth1.
Step 4. Now add both the interfaces to this virtual interface.
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
Now run the below command to bring the interface up:
ii) For setting a static IP address, use the following details
Now run the below command to bring the interface up:
If the network does not work after rebooting, try removing /etc/network/interfaces.d/setup file to fix the issue.
Step 1. Run the following command to list all the available interfaces with their IP address:
or
While running “ifconfig,” you may encounter an error: “ifconfig: command not found”. For fixing this error, we need to install the “net-tools” package:
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.
Step 3. Verify if the IP has been added to this interface:
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:
Step 5. Now save the file and bring down the interface and then again bring up the interface to apply the changes:
Now verify the connectivity of the interface with the ping command:
If everything goes right, you should see a ping coming from the new IP address.
Step 1. Run the below command to select the interface for you which you want to change the MAC address for:
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.
Step 3. Now enter the new mac address as below:
Step 4. Now bring up the interface again:
That’s all configuring the new mac address; you should see the new mac address:
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.
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:
b) To bring up an interface:
To delete an IP from the network interface, use the below command:
Replace ‘your IP address’ with your IP address, e.g., the following command will delete the IP 192.168.2.2
If you have multiple IP addresses for an interface, you can delete all as shown below:
The route or ip command can be used to set a Default Gateway:
or
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.
]]>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.
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.
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.
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.
We can use any text editor besides nano like vi or vim.
Step 2. Add the following content to the Dockerfile and save it.
Step 3. Now, as we have our Dockerfile ready, it’s time to build The image. Just use the following command:
Syntax:
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:
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:
Step 5. Now we will run our docker image to see if it is working as expected:
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:
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:
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:
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.
]]>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.
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.
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
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.
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:
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:
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:
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:
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
To check the processor type on a Ubuntu machine, just use the following command:
For a detailed list of the various feature of your CPU, use the following command:
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.
First, install the LDAP client and all the packages necessary for LDAP to work properly in Debian 10 by issuing the command below:
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.
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.
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.
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:
Now, specify an account that will be used as the LDAP root user account, after which you will press the Enter key.
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.
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:
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:
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.
Now, enter the name of the LDAP root account that you set up earlier. After that, press the Enter key to continue.
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:
Next, configure your Debian 10 system to use LDAP for authentication. To do so, update the PAM configurations by running the following command:
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.
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:
When this file opens with the nano editor, enter the following line of code at the end of this file:
After adding this line, press Ctrl + X to save your file and exit the nano editor.
Restart the name service cache daemon (nscd) so that it can read the new configurations. The ncsd can be restarted with the following command:
Restarting this service will not display any messages in the terminal.
Finally, re-enable the name service cache daemon (nscd) with the command below:
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.
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:
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:
This command will remove all the packages that are no longer needed after removing the LDAP client from Debian 10.
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.
]]>For installing the NIS server on a Debian 10 machine, you will have to perform three basic steps:
First, you have to update your system with the following command:
After successfully updating your system, you will receive the messages shown in the image below:
Now, we can install the NIS server with the following command:
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:
After installing the NIS server on Debian 10, we can now go on with its configuration steps as follows:
First, we need to start the “rpcbind” service on Debian 10 with the command shown below:
Now, we will check whether the “rpcbind” service has been successfully started or not by running the following command:
You can easily see the status of the “rpcbind” service on our Debian 10 system highlighted in the image below:
After that, we will start the “ypserv” service on Debian 10 with the following command:
Now, we will check whether the “ypserv” service has been successfully started or not by running the command shown below:
You can easily see the status of the “ypserv” service on our Debian 10 system highlighted in the following image:
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:
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.
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:
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.
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:
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.
After making all these configurations, we will restart the NIS server with the following command:
Finally, we will update the NIS database with the command shown below:
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:
We can also remove the NIS server from our Debian 10 system any time by going through the following two steps:
First, we will run the command shown below to remove the NIS server and its configuration files:
Finally, we will also remove all the unused packages and dependencies with the following command:
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.
]]>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.
To install Swift in Debian, open the terminal using the Ctrl + Alt + T shortcut, then follow the
steps listed below:
To update your packages, run the following command in the terminal window:
The above command will begin to update the packages of your Debian server.
To install all the dependencies required to install Swift on a Debian 10 server, issue the following command in the terminal window:
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.
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:
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:
Next, move this newly extracted folder to the opt directory using the following command:
You must add the Swift installation path into the PATH environment variable of your system. To do so, issue the following command:
After that, issue the following:
This marks an end to the process of installing and configuring Swift on the Debian 10 server.
To verify the installation of Swift, issue the following command in the terminal window:
The output will display the version of Swift installed on your server. This output indicates a successful installation process.
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.
]]>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.
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:
Next, use the simple apt to command to install the tool.
If you have a desktop environment installed on your system and prefer a GUI version of the tool, install unison-gtk using the command:
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.
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.
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.
The first step is to create a private and public key on the remote server1.
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:
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:
On server2, create a directory as above
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.
Having the files, we want to sync in the right directory, run unison command to sync from server one as:
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:
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:
In the file, add the following lines:
The above lines disable prompts when syncing files, automating the process.
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:
In the file, start with a shebang and add the unison sync command:
As usual, make the script execute permissions:
Now edit your cronjob file with crontab:
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:
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.
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:
]]>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).
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.
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
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.
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:
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:
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:
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:
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.
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/
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.
Using basic SQLite syntax, we can select specific information from a table using the SELECT statement as shown:
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.
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/
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:
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
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.
]]>This article will give you a complete description of the R programming language installation on the Debian 10 system.
You should have the following prerequisites for R language installation:
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:
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.
Use the following command to install all necessary packages which are required to add a new CRAN repository:
Execute the below-mentioned command to enable the CRAN repository and import the following CRAN GPG key to your system:
Update the packages by running the below-mentioned command:
Use the below command on the terminal to install R on your system as follows:
Now, check the R language installation on your Debian 10 system by using the below-given command:
You will notice that the latest stable version of R is printed on the terminal:
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:
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:
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:
Installation of the ‘Stringr’ package will complete in a few seconds. After that, you will load the relevant library by using the following command:
In this program, we will create a character vector with name tutorial as follows:
Now, use the following command to print this on the terminal:
To find the length of the string, type the command as follows:
The following vector length will display on the screen:
You can also install more R packages from CRAN by using the following command:
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.
]]>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.
The SysStat utility in Debian 10 can be installed by running the following command:
As soon as the SysStat utility is successfully installed on your Debian 10 system, these messages will be displayed on the terminal:
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:
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.
Now we need to re-enable the SysStat service in Debian 10 with the following command:
The successful execution of the above-mentioned command will display the messages shown in the image below:
Once the SysStat service is enabled on Debian 10, we need to restart it with the following command:
The error-free execution of this command will display the messages shown in the image below:
We can also check the status of the SysStat service in Debian 10 with the following command:
The status of the sysstat service on our Debian 10 system is shown in the image below:
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:
The CPU statistics of our Debian 10 system are shown in the image below:
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:
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:
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.
]]>Note: The commands have been tested on the latest release of Debian i.e., Debian 10.
Follow the below steps in order to setup vsftpd server on Debian 10:
First, update the repository index using the below command in Terminal:
Now, you can install vsftpd as follows:
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:
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:
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:
Now to confirm if the rules have been added, run the below command in Terminal:
The below output shows the Firewall has allowed the FTP ports.
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:
Now edit the vsftpd configuration file as follows:
Now modify the configurations to match them as follows:
Now save and close the vsftpd.conf configuration file.
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:
Then set its password using the command below:
Add the user to the allowed FTP users list:
Once you have finished the configurations, restart the vsftpd service. Run the command below to do so:
To enable the vsftpd as a startup, run the following command in the Terminal:
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:
To launch Filezilla, either search it through the Applications list or simply execute the following command in Terminal:
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:
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.
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.
]]>