Linux Resources
- Home
- Linux Resources
This article covers how to create a user with sudo privileges. You can now log in to your CentOS server with this user account and use sudo to run administrative commands.
Performing server administration as a non-root user is a best practice.
For security, your first task when deploying a CentOS instance is to create a non-root user with sudo access.
How to Add a New User Account on CentOS Linux System ?
1. To Create a new user account with the adduser command:
# adduser example_user
2. Set a strong password for the new user (new_user) with passwd.
# passwd new_user
This article covers how to install MariaDB version on a Debian 10 server, and verify that it is running and has a safe initial configuration.
How To Install MariaDB on Debian 10 ?
1. To install MariaDB, update the package index on your server with apt:
$ sudo apt update
2. Then install the package:
$ sudo apt install mariadb-server
3. To Configure MariaDB, Run the security script:
$ sudo mysql_secure_installation
This article covers how to Configure up Apache Virtual Hosts on a Debian 10 server. Using Apache Virtual Hosts you can host multiple domains on a single server.
Apache will break its functionality and components into individual units so you can customize independently. The basic unit that describes an individual site or domain is called a virtual host.
How to configure Apache Virtual Hosts on Debian ?
Apache is a free and open source web server used web server in the world, and it is commonly used in Linux servers.
To install Apache:
1. Check whether apache is already installed and running on your server. You can do this with the following command:
$ dpkg -l apache2
2. If apache is not installed, you can do this by running the following commands. First, make sure that the system repositories are up to date:
$ apt-get update
3. To install the Apache web server, execute the following:
$ apt-get install apache2
4. After the installation is complete, you should enable Apache to start automatically upon server reboot with:
$ systemctl enable apache2
5. You can also check the status of your Apache service with the following command:
$ systemctl status apache2
If you want to secure your website with an SSL certificate, you can generate and Install a free Letsencrypt SSL certificate.
This article covers how to use certbot client of Let’s Encrypt to obtain SSL certificate for you domain.
To set these up DNS records for your server, you can follow these instructions for adding domains and then these instructions for creating DNS records:
To install Certbot as a snap on Debian,
You must first have snapd installed on your server.
snapd is a daemon required to install, use, and manage snaps.
Installing the snapd package will also install the snap command on your server.
1. To install snapd, update your local package index if you've not done so recently:
$ sudo apt update
2. Then install the snapd package:
$ sudo apt install snapd
After running this command, you'll be prompted to confirm that you want to install snapd and its dependencies.
Do so by pressing Y and then ENTER.
3. Next, use the snap command to install the core snap. This will install some dependencies on your server that are needed for any snap you install, including the Certbot snap:
$ sudo snap install core
4. Then refresh the core snap. Doing so will ensure that you have the latest versions of snapd and its dependencies installed:
$ sudo snap refresh core
Following that, you can install the certbot snap with the following command.
5. Because Certbot must be allowed to edit certain configuration files in order to correctly set up certificates, this command includes the --classic option. This confinement level allows any snaps installed under it the same access to system resources as traditional packages:
$ sudo snap install --classic certbot
6. Create a symbolic link to this file in the /usr/bin/ directory to ensure that you can run the certbot command anywhere on your system:
$ sudo ln -s /snap/bin/certbot /usr/bin/certbot
This article covers how to archive and compress files using tar and zip commands with a few examples to show you how it works.
The tar command on Linux is often used to create .tar.gz or .tgz archive files, also called "tarballs".
How to Remove Files from a Tar Archive ?
Use the --delete operation to remove files from an archive.
The following example shows how to remove the file file1 from archive.tar:
$ tar --delete -f archive.tar file1
This article covers the installation procedure of Go language on a Linux Mint 20 system. Also, we dealt with an easy way to remove Go language from a Linux Mint 20 system.
To Verify Go Language Installation, run the command:
$ go version
Features of Go Programming