I am a big fan of LXD, a next-generation Linux system container manager and default on Ubuntu. It allows me to run desktop apps or server apps in an isolated environment. Ubuntu provides LXD with robust security in mind. However, this might lead to undesired side effects, such as individual packages under OpenSUSE or CentOS Linux may not be updated. One such package is the filesystem package. Let us see how to fix Error: Transaction failed when you try to update filesystem package under CentOS, OpenSUSE, and other Linux containers running under LXD.
The post Linux Filesystem Error: Transaction failed when using LXD appeared first on nixCraft.
How do I check or find NetworkManager version on Linux distribution?
The post How to find NetworkManager version on Linux appeared first on nixCraft.
We can easily add a key file to LUKS disk encryption on Linux when running the cryptsetup command. A key file is used as the passphrase to unlock an encrypted volume. The passphrase allows Linux users to open encrypted disks utilizing a keyboard or over an ssh-based session. There are different types of key files we can add and enable LUKS disk encryption on Linux as per our needs:
Let us see how to enable LUKS disk encryption with a key file.
The post How to enable LUKS disk encryption with keyfile on Linux appeared first on nixCraft.
How can I check if a file does not exist in a Bash script?
The post How to check if file does not exist in Bash appeared first on nixCraft.
All supported versions of FreeBSD are affected by various security bugs that need to be applied ASAP. If the process is privileged, it may escape jail and gain full access to the FreeBSD system. Similarly, when using Xen, a malicious or buggy frontend driver may be able to cause resource leaks. Let us see what and how to fix these security vulnerabilities on FreeBSD.
The post FreeBSD jail, xen, and .pam_login_access security fixes released appeared first on nixCraft.
How do I check memory utilization in Linux using command-line and GUI options?
The post How to check memory utilization in Linux appeared first on nixCraft.
Dart is easy to use BSD licensed programming language to build mobile, desktop, server, and web apps. Google creates and maintains the Dart ecosystem. It follows C-style syntax. We can compile code either to the native platform or JavaScript. Flutter allows building iOS/Android mobile and desktop/web apps from a single code base. Let us see how to install Dart programming language on a Debian or Ubuntu Linux and set vim as IDE.
The post How to install Dart on Linux and set up VIM as IDE appeared first on nixCraft.
Despite some severe bugs in sudo, it remains the defacto tool to gain root shell or run command as another user on Linux, macOS, and Unix-like systems. The sudo command allows the system administrator to grant an individual user access to unprivileged commands. For instance, I can give developers the ability to restart the Apache webserver or PHP/Python process on a Linux server. Let us see how to remind developers and unprivileged users about the power of sudo for fun and profit. In this quick tip, I will show you how to add some spice to your sudo session with a lecture file on Linux or Unix.
The post Adding spice to your sudo session with a lecture file on Linux or Unix appeared first on nixCraft.
So bizarrely, I forgot my WordPress admin password, including my login name. I did not add my login details to my password manager either. The container image that I built lacking outgoing email support (SMTP) too. I got stuck. Fortunately, I have full root access to my MySQL/MariaDB server hosted at AWS EC2, and here is how to reset a forgotten WordPress password using MySQL command-line.
The post How to reset WordPress password using MySQL CLI appeared first on nixCraft.
I have multiple wireguard profiles on Linux. Is there any way to import WireGuard profile (/etc/wireguard/wg{0,1,2}.conf files) using nmcli on Linux? I don't want to become root and run systemctl start wg-quick@wg0. How can I import an existing WireGuard profile from using NetworkManager command-line interface?
The post How to import WireGuard profile using nmcli on Linux appeared first on nixCraft.
Raspberry Pi is a little useful computer for learning programming and building projects. It comes with Debian Linux based modified operating system called Raspbian. It is the most wildly installed OS on RPi. In a recent update, the Raspberry Pi Foundation installed a Microsoft apt repository on all machines running Raspberry Pi OS without the person's or admin's knowledge. Every time a Raspbian device is updated by having this repo, it will ping a Microsoft server. Microsoft telemetry has a bad reputation in the Linux community. Let us see why and how this matters to Linux users.
The post Heads up: Microsoft repo secretly installed on all Raspberry Pi’s Linux OS appeared first on nixCraft.
How do I remove all the carriage returns \r (^M) from a file in Unix using the command-line options?
The post How to remove carriage return in Linux or Unix appeared first on nixCraft.
Linode is an original cloud platform and founded before AWS. Back then, we used to call them VPS (Virtual Private Server). Recently they added a new firewall feature to control network access to my Linode server from the Cloud. Let us test drive Linode cloud firewall.
The post Linode cloud firewall: Do you need it to protect the Linux server? appeared first on nixCraft.
I need to restrict access to /app/ directory on Nginx. How do I set up password protect a directory with Nginx .htpasswd authentication on Linux or Unix-like systems?
The post How to password protect directory with Nginx .htpasswd authentication appeared first on nixCraft.
Bonsai (盆栽) is nothing but planting in a try. It is old age Japanese art of growing small trees in pots. Now you can do that with your Linux or Unix terminal easily for fun and profit. Let us look into the Bonsai tree generator called cbonsai created in Clang and Bash.
The post Linux Desktop Fun: Bonsai tree generator for CLI lovers appeared first on nixCraft.
I need to set a bash environment variable called PURGEIMAGE and take specific actions in my script. For example, if PURGEIMAGE set, then purge images from CDN else just URL. I am going to call my script as PURGEIMAGE=yes ./purgecache.sh url1 url2. So how do I know if a bash variable set at the CLI and used in my bash script running on Linux or Unix-like systems?
The post How to check if bash variable defined in script appeared first on nixCraft.
Bhyve (BSD hypervisor") is a free and opensource hypervisor for FreeBSD. We can use Bhyve to run Linux, Windows, and *BSD guest operating system as a virtual machine. Let us see how to install Linux VM using Bhyve on FreeBSD host operating system along with ZFS and bridged networking.
The post How to install Linux VM on FreeBSD using bhyve and ZFS appeared first on nixCraft.
I have Debian 10 Linux cloud server, and it is configured to get IP addresses via DHCP. How do I convert DHCP address to static IP address settings?
The post How to set up static IP address on Debian Linux 10/11 appeared first on nixCraft.
Any logged-in unprivileged user can abuse an old bug in sudo to gain root privileges. It was rated as an important security issue for Linux and Unix-like operating systems. The Qualys research team has discovered the heap overflow vulnerability in sudo itself has been hiding in plain sight for nearly 10 years. The bug allows any local users to gain root access without authentication (no user's password needed). We need to apply patches to our operating systems as soon as possible.
The post Critical bug in sudo puts Linux and Unix systems at risk appeared first on nixCraft.
Homebrew is an essential package manager for developers, sysadmins, and power users on macOS. Homebrew allows us to install the latest and updated version of popular applications, packages, and developer tools. Homebrew is the painless way to install required packages on your Mac. For instance, we can install PostgreSQL, Python, PHP, Bash, Nginx, Apache, and much more using brew command. This page explains how to install and use Homebrew on the macOS system to get missing packages. Homebrew installs the apps you need that Apple didn't include in their base operating system or app store.
The post How to install Homebrew on macOS to use the brew package manager appeared first on nixCraft.
I have two columns (fields) in my text file. I am trying to insert '|
FOO This is a description
BAR Another description for bar
TEXT Another description for TEXT
So I ran awk '{ print $1 "|"; $1=""; print}' input > output but print command is adding a new line:
FOO|
This is a description
BAR|
Another description for bar
TEXT|
Another description for TEXT
Is there any way to tell awk not to print a newline and create the file? Here is what I want so that I can create final HTML table based upon '|'
FOO|This is a description
BAR|Another description for bar
TEXT|Another description for TEXT
The post How to force awk not to print a newline appeared first on nixCraft.
Last year, the Raspberry Foundation also released a brand new version of the Raspberry PI PC (personal computer), and it is directly built into a small-sized keyboard. Now there is more good news for hackers and hardware developers. They just announced their first microcontroller-based product named Raspberry Pi Pico. This small device is priced at only US $4. Unbelievable price. Let us find out about Raspberry Pi Pico hardware specs and software support.
The post Raspberry Pi Pico released and available at $4 only appeared first on nixCraft.
As you know, Red Hat recently announced that CentOS Linux 8, as a rebuild of RHEL 8, will end in 2021. CentOS Stream continues after that date, serving as the upstream (development) branch of Red Hat Enterprise Linux. The news met with a strong reaction from the open-source community and CentOS users. Today, Red Hat released a new option where RHEL developer subscriptions can now be used in production environments. The developers and team can have up to 16 systems. In other words, it is a no-cost RHEL that small groups and developers can use to build packages and in production environments.
The post Red Hat introduces new no-cost RHEL option appeared first on nixCraft.
ShellCheck is easy to use, free, and open-source static analysis tool that automatically finds bugs in your shell scripts. If you write shell scripts for automation or containers, you need this tool. Let us see how to install and use ShellCheck on the FreeBSD development Unix server.
The post How to install ShellCheck on FreeBSD – A shell script static analysis tool appeared first on nixCraft.
We use the df command to show how much disk space is free on mounted file systems in Linux, macOS, and Unix-like systems. We also have the du command to estimate file space usage. We now have another fancy and fantastic looking tool called duf to display statistics on free disk space in Unix, Linux, macOS, *BSD, Android, and Windows written in Golang.
The post duf – Disk Usage/Free Utility for Linux, BSD, macOS & Windows appeared first on nixCraft.
How do I install or add Brotli compression support to Nginx on OpenSUSE Linux to speed up my webpages and apps?
The post OpenSUSE install Brotli module for Nginx appeared first on nixCraft.
How do I install, set up and configure a FreeBSD 12 jail with VNET on ZFS? How can I create FreeBSD 12 VNET jail with /etc/jail.conf to run OpenVPN, Apache, Wireguard and other Internet-facing services securely on my BSD box?
The post How to set up FreeBSD 12 VNET jail with ZFS appeared first on nixCraft.
On Linux, we encrypt our partitions and entire disk using Linux Unified Key Setup-on-disk-format (LUKS) for security and privacy reasons. We unlock LUKS protected disk by providing a passphrase at boot time. You need to be in front of your computer or use a remote console to open the encrypted disk under Linux at boot time. However, if your system is in the basement, remote datacenter/office, or upstairs office, you won't able to unlock and boot your Linux box. We can use the Dropbear SSH server for LUKS encrypted Debian or Ubuntu or any other Linux distro via SSH to solve this problem. Let us see how to unlock LUKS using Dropbear SSH keys in Linux at boot time.
The post How to unlock LUKS using Dropbear SSH keys remotely in Linux appeared first on nixCraft.
The last ten years in the computer and IT security world are crippled with so many vulnerabilities. We saw massive cloud computing adoption and end-users using mobile devices with high speed 4G LTE networks. A threat actor may have exploited such weakness in modern computers and networks. Let us look into top vulnerabilities and the attack surface in this decade (2010-2020) that affected Linux/Unix, macOS, IT, cloud-computing, and computers in general.
The post Significant vulnerabilities that crippled IT world this decade (2010-2020) appeared first on nixCraft.
A text editor is an essential tool for both developers and sysadmin, especially when dealing with text based sessions. We use a text editor to create, edit, and update text. A text editor is used for many things. Some use them to write documents. Some people write code and others use it to edit Linux and Unix configuration files locally or remote servers running in the cloud. Let us see the top 6 text editors for Linux, macOS, and Unix command-line users/developers.
The post Top 6 awesome text editors for Linux and Unix command-line users/developers appeared first on nixCraft.
FreeBSD is an open-source and free Unix-like operating system descended from the Berkeley Software Distribution (BSD). This quick tutorial explains how to download and prepare the USB stick/pen drive to install FreeBSD 12.2 to install FreeBSD using the target computer's USB port.
The post How to write FreeBSD image to USB disk for installation using dd command appeared first on nixCraft.
We use encryption to protect mobile devices. For instance, I always use LUKS disk encryption to protect all files stored on my SSD. Dm-crypt (Cryptsetup and LUKS) open-source disk encryption is transparent disk encryption and a great way to keep your data secure. However, changing passphrase is a bit of a challenge for new Linux users and developers. This step-by-step guide explains how to find LUKS slots assigned to you and change your passphrase on a Debian/Ubuntu, CentOS/RHEL, OpenSUSE/SUSE other Linux distros.
The post How to change LUKS disk encryption passphrase in Linux appeared first on nixCraft.