5331 private links
While connecting to your server through SSH can be very secure, the SSH daemon itself is a service that must be exposed to the Internet to function properly. This comes with some inherent risk and offers a vector of attack for would-be assailants.
Any service that is exposed to the network is a potential target in this way. If you pay attention to application logs for these services, you will often see repeated, systematic login attempts that represent brute-force attacks by users and bots alike.
A service called Fail2ban can mitigate this problem by creating rules that automatically alter your iptables firewall configuration based on a predefined number of unsuccessful login attempts. This will allow your server to respond to illegitimate access attempts without intervention from you.
In this guide, we’ll cover how to install and use Fail2ban on a CentOS 7 server.
Any service that is exposed to the internet is susceptible to attacks from malicious parties. If your service requires authentication, illegitimate users and bots will attempt to break into your system by repeatedly trying to authenticate using different credentials.
A common example of this is with SSH, which will be the subject of bot attacks that attempt to brute force common account names. Luckily, services like fail2ban were created to help us mitigate these attacks.
Fail2ban works by dynamically altering the firewall rules to ban addresses that have unsuccessfully attempted to log in a certain number of times. In a previous guide, we discussed how to get fail2ban up and running on Ubuntu 14.04.
In this guide, we’ll discuss in more depth how fail2ban actually works and how you can use this knowledge to modify or extend the behavior of this service.
The Basic Concept
The basic idea behind fail2ban is to monitor the logs of common services to spot patterns in authentication failures.
When fail2ban is configured to monitor the logs of a service, it looks at a filter that has been configured specific to that service. The filter is designed to identify authentication failures for that specific service through the use of complex regular expressions.
Here you can download the Linux Kernel Crash Book, in PDF format. The book is 182 pages long, contains 113 screenshots and weighs 4.87MB.
https://www.dedoimedo.com/computers/www.dedoimedo.com-crash-book.pdf
Below, you can find links to the original seven articles that comprise the Kernel Crash series, starting with LKCD and Kdump, via specific setup on CentOS and openSUSE, ending with collection and analysis of memory cores.
Analyzing Linux kernel crash dumps with crash - The one tutorial that has it all
Updated: June 14, 2010
This article is a part of my Linux Kernel Crash Book. It is available for free download in PDF format!
Finally, the big moment has come. Reading the information displayed by the crash utility, understanding what those curious lines mean and hacking your way through the problem to the other side.
Mail hosting made simple.
Modoboa is a mail hosting and management platform including a modern and simplified Web User Interface. It provides useful components such as an administration panel or a webmail.
Modoboa integrates with well known software such as Postfix or Dovecot. A SQL database (MySQL, PostgreSQL or SQLite) is used as a central point of communication between all components.
Modoboa is developed with modularity in mind, expanding it is really easy. Actually, all current features are extensions.
It is written in Python 3 and uses the Django, jQuery and Bootstrap frameworks.
SOGo offers multiple ways to access calendaring and messaging data. Your users can either use a web browser, Microsoft Outlook, Mozilla Thunderbird, Apple iCal, or a mobile device to access the same information.
SOGo is a highly interoperable solution due to its adoption and promotion of open standards. Among those, SOGo particularly focuses on:
CalDAV: The Calendaring Extensions to WebDAV protocol is vastly popular among clients (Apple iCal, Mozilla Lightning, etc.) and allows them to exchange calendar components with servers that support it.
CardDAV: In its fourth revision, vCard Extensions to WebDAV is to address books / contacts what CalDAV is to calendaring. Less popular than CalDAV, it's nevertheless quickly gaining momentum and is used by the SOGo Connector extension.
Mail protocols: For messaging, SOGo fully makes use of standard protocols such as IMAP and SMTP.
iRedMail - Open Source Mail Server Solution
The right way to build your mail server with open source softwares.
Works on Red Hat, CentOS, Debian, Ubuntu, FreeBSD, OpenBSD.
Since 2007.
With iRedMail, you can deploy an OPEN SOURCE, FULLY FLEDGED, FULL-FEATURED mail server in several minutes, for free.
We did the heavy lifting of putting all the open source components together and applying best practices. Our product does all the major tasks for you. Furthermore we offer professional support to back you up in case you have some problems.
Mail-in-a-Box lets you become your own mail service provider in a few easy steps. It’s sort of like making your own gmail, but one you control from top to bottom.
Technically, Mail-in-a-Box turns a fresh cloud computer into a working mail server. But you don’t need to be a technology expert to set it up.
Here’s how you can get a Mail-in-a-Box running:
Each Mail-in-a-Box provides webmail and an IMAP/SMTP server for use with mobile devices and desktop mail software. It also includes contacts and calendar synchronization.
- Roundcube Webmail
- Nextcloud Contacts
- A Control Panel //
If you are an expert and have a domain name and a completely fresh Ubuntu 18.04 machine running in the cloud, you basically just run on that machine:
curl -s https://mailinabox.email/setup.sh | sudo bash
You will be asked to enter the email address you want and a few other configuration questions. The script will install (and uninstall!) and configure a few dozen Ubuntu packages and the Mail-in-a-Box control panel. Consult the setup guide for complete details. See the README on github for advanced instructions.
Please note that the goal of this project is to provide a simple, turn-key solution. There are basically no configuration options and you can’t tweak the machine’s configuration files after installation. If you are looking for something more advanced, try iRedMail or Modoboa.
💌 Mail app for Nextcloud.
A mail app for Nextcloud
Integration with other Nextcloud apps! Currently Contacts, Calendar & Files – more to come.
📥 Multiple mail accounts! Personal and company account? No problem, and a nice unified inbox. Connect any IMAP account.
🔒 Send & receive encrypted mails! Using the great Mailvelope browser extension.
📑 Message threads! Now we have proper grouping of message threads.
🗄️ Mailbox management! You can edit, delete, add submailboxes and more.
🙈 We’re not reinventing the wheel! Based on the great Horde libraries.
📬 Want to host your own mail server? We don’t have to reimplement this as you could set up Mail-in-a-Box!
Want to have crontab use the editor of your choice instead of the other way around? This tutorial shows you how. These instructions will work with Linux, macOS and other Unix-like operating systems. //
select-editor
or
echo export VISUAL="nano" >> ~/.bash_profile
source ~/.bash_profile
or
. ~/.bash_profile
$# Stores the number of command-line arguments that
were passed to the shell program.
$? Stores the exit value of the last command that was
executed.
$0 Stores the first word of the entered command (the
name of the shell program).
$ Stores all the arguments that were entered on the
command line ($1 $2 ...).
"$@" Stores all the arguments that were entered
on the command line, individually quoted ("$1" "$2" ...).
So basically, $# is a number of arguments given when your script was executed. $ is a string containing all arguments. For example, $1 is the first argument and so on. This is useful, if you want to access a specific argument in your script.
As Brian commented, here is a simple example. If you run following command:
./command -yes -no /home/username
$# = 3
$* = -yes -no /home/username
$@ = array: {"-yes", "-no", "/home/username"}
$0 = ./command, $1 = -yes etc.
In this article i will show the format of a crontab and explain how to schedule a cron job in Linux.
You will also find here the most popular examples of cron job schedules, such as every minute cron job, every 5 minutes, every hour, every day (daily cron job) and others.
Emsisoft Emergency Kit is a virus scanner that’s a useful starting point, while Dr.Web CureIt! will scan your computer for common malware that may have taken root. Then there’s Avira Rescue System, which can scan for and repair various problems with the settings and configuration of Windows. Microsoft has its own virus scanner that can run from a USB drive too: Microsoft Safety Scanner.
Run a portable operating system
We’ve mentioned portable apps, but you can also carry an entire computer with you on a USB drive—operating system, applications, files, and all. The open-source Linux OS is perfect for this, and several distributions of Linux can be run in a portable mode, including Linux Lite, Puppy Linux, and MX Linux. Have a look around to see which distro might suit you best. //
As a safety net should something go seriously wrong with your PC, you can create a Windows recovery drive on a spare USB stick. In Windows, open the Start menu, and search for “create a recovery drive” to bring up the right utility. Follow the instructions on screen to copy over the necessary files to your chosen USB drive, but note that these files won’t include your personal files and data
Since its launch, the Raspberry Pi OS (and most operating systems based on it) has shipped with a default "pi" user account, making it simpler to boot up a Pi and start working without needing to hook up the device to a monitor or go through a multi-step setup process. But as of today, that's changing—new installs of the Raspberry Pi OS are shedding that default user account for both security and regulatory reasons.
Try this
sudo dnf upgrade --refresh rpm glibc
sudo rm /var/lib/rpm/.rpm.lock
sudo dnf upgrade dnf
Regards
modzilla99 commented on Nov 25, 2019
Thanks! That resolves that issue!
Let’s look at how things stand in terms of migration. The first Rocky Linux release also includes a conversion tool (migrate2rocky) that can assist you in migrating your CentOS system to Rocky Linux. You can migrate an existing CentOS, AlmaLinux, RHEL, or Oracle Linux installation to Rocky Linux.
Note that the mentioned tool can migrate any listed distributions only to Rocky Linux.
Now let’s look at AlmaLinux’s approach. First, they started a whole new project called ELevate, which is their initiative to allow users to upgrade or migrate between any RHEL-based distro.
Did you see the difference between “only to” in Rocky’s case and “to any” in AlmaLinux’s approach? In my eyes, AlmaLinux’s path is nobler, closer to the spirit of open source and the freedom to choose, and I respect that.
As a standard feature of the Linux kernel, device tree overlays (DTOs) allow for easy enabling and configuration of features and drivers, such as those contained within the standard firmware of a Raspberry Pi system. Using these DTOs it’s trivial to set up features like as a soft power-off button, triggering an external power supply and enable drivers for everything from an external real-time clock (RTC) to various displays, sensors and audio devices, all without modifying the operating system or using custom scripts.
If you are reading this, you have likely attempted or actually set up a dual-boot system between your favorite Linux distribution and Windows. And if you did that on a computer with a single hard drive, that is, dual-booting Windows and Linux alongside each other, you probably replaced the Windows boot loader with GRUB, the Linux boot loader, in the Master Boot Record (MBR).
Though that is not what I recommend, many still prefer it that way, even as I have written in many of my dual-boot tutorials that Windows will, during a reinstall, overwrite anything it finds in the MBR, and that some anti-virus programs tend to write small files to the MBR, messing up GRUB.
For the record, my recommendation is to install the Linux boot loader, not in the MBR, but in the Linux installation’s boot partition, or the main partition, if /boot is not on a separate partition. This gives the Windows boot manager the main responsibility of presenting what operating system to boot into during a restart or reboot.
That way, if you have to reinstall Windows, you will not lose access to the Linux side of the dual-boot system. If you installed the Linux boot loader to the MBR and want to restore the Windows boot loader, this short tutorial shows you how to do it. It is an easy, point-and-click process. And the application that makes it that easy is called EasyBCD, a free-for-personal-use application from Neosmart Technologies.
To complement and contrast the two most popular answers, . ~/.bashrc and exec bash:
Both solutions effectively reload ~/.bashrc, but there are differences:
. ~/.bashrc or source ~/.bashrc will preserve your current shell session:
Except for the modifications that reloading ~/.bashrc into the current shell (sourcing) makes, the current shell process and its state are preserved, which includes environment variables, shell variables, shell options, shell functions, and command history.
exec bash, or, more robustly, exec "$BASH"[1], will replace your current shell with a new instance, and therefore only preserve your current shell's environment variables (including ones you've defined ad hoc, in-session).
In other words: Any ad-hoc changes to the current shell in terms of shell variables, shell functions, shell options, command history are lost.
Depending on your needs, one or the other approach may be preferred.
Note: The above applies analogously to other shells too:
To apply the exec approach to whatever your default shell is, use exec $SHELL
Similarly, the sourcing approach requires you to know and specify the name of the shell-specific initialization file; e.g., for zsh: . ~/.zshrc
[1] exec bash could in theory execute a different bash executable than the one that started the current shell, if it happens to exist in a directory listed earlier in the $PATH. Since special variable $BASH always contains the full path of the executable that started the current shell, exec "$BASH" is guaranteed to use the same executable.
A note re "..." around $BASH: double-quoting ensures that the variable value is used as-is, without interpretation by Bash; if the value has no embedded spaces or other shell metacharacters (which is likely in this case), you don't strictly need double quotes, but using them is a good habit to form.
The mechanism for managing and starting processes on boot has been changed. Until RHEL/CentOS 6.x, you would have created a script in /etc/init.d/ and enabled with the help of chkconfig but things are different on RHEL 7.
It’s replaced by systemd and since it is more or less the default process manager on major Linux versions, System Admin versed in other flavors will feel right at home. In this article, we will explore what systemd is, what the reasons to the switch were, and how to use systemd to set up, run and manage background processes with it.