On Linux and other Unix-based operating systems, sudo is used to run a program with the privileges of another user, often root. When we need to modify a file which requires administrative privileges to be edited, if we launch our favorite text editor directly with sudo, it will run without the customization and settings we use when we invoke it normally, since the environment of the invoking user is not preserved. In this tutorial we will see how can we easily solve this problem and how we can modify system files securely by using sudoedit.

In this tutorial you will learn:

  • How to edit a system file using sudoedit
  • What are the steps performed when a file is edited with sudoedit
  • How to set the default editor used by sudo
sudoedit

Sharing files between computers and servers is an essential networking task. Thankfully, NFS (Network File System) is available for Linux systems and makes the job extremely easy. With NFS properly configured, moving files between computers is as easy as moving files around on the same machine. Since NFS functionality is built directly into the Linux kernel, it is both powerful and available on every Linux distro, although the configuration can differ slightly between them.

In this guide, we'll show how to install and configure NFS on major Linux distros, like Ubuntu and others based on Debian, and Fedora and others based on Red Hat. The configuration will involve a server (which hosts the files) and one client machine (which connects to the server to view or upload files). Follow along with the steps below to get NFS setup on your own system.

In this tutorial you will learn:
  • How to install NFS server
  • How to configure NFS server shares
  • How to connect to NFS server from client machines

One of the many desirable features built directly into Docker is networking. Docker's networking feature can be accessed by using a --link flag which allows to connect any number of Docker containers without the need to expose a container's internal ports to the outside world.

In this guide, you will learn how to network two or more Docker containers together on a Linux system through command line instructions. This will work on any Linux distribution. Check out the step by step instructions below to find out how.

In this tutorial you will learn:
  • How to network Docker containers together

The Apache web server has the ability to serve multiple websites from the same IP address, using virtual hosts. Each Virtual Host can be configured in the main server configuration file, or, thanks to the Include or the IncludeOptional directives, in its own dedicated one. When the number of virtual hosts increases, their management starts to become troublesome. If their configuration is quite similar, we can manage them dynamically, thanks to the mod_vhost_alias module. In this tutorial we will see how to do it.

In this tutorial you will learn:

  • What is an Apache virtual host
  • How to check if the mod_vhost_alias module is enabled
  • How to load the mod_vhost_alias module on Debian and Red Hat family of distributions
  • How to manage dynamic virtual hosts using the mod_vhost_alias module
apache-logo

NTFS stands for New Technology File System and is created by Microsoft for use on their Windows operating systems. It doesn't see much use on Linux systems, but has been the default file system on Windows for many years. Linux users are probably used to seeing drives with the ext4 file system, which is normally the default and definitely the most widespread in the Linux world.

Although NTFS is a proprietary file system meant especially for Windows, Linux systems still have the ability to mount partitions and disks that have been formatted as NTFS. Thus a Linux user could read and write files to the partition as easily as they could with a more Linux-oriented file system. This can be particularly handy in situations where you recover a disk from a Windows machine and wish to read the contents from your Linux system.

In this guide, we'll show command line examples of how to mount NTFS partitions on any Linux distribution. This will include examples for mounting with only read access, or read and write access, as well as temporary mounting or persistent mounts that will survive future reboots. Read on to learn how.

In this tutorial you will learn:
  • How to install ntfs-3g and fuse on all major Linux distros
  • How to mount NTFS formatted partition on Linux
  • How to persistently mount NTFS partition
  • How to mount NTFS partition with read only and read and write access

In this guide, we will show command line examples for removing all Docker containers from a Linux system. This will work on any Linux distribution.

Along with removing Docker containers, you'll also learn how to remove Docker images, volumes, and networks. This is useful when you want to completely purge all traces of containers from your Docker installation and start fresh. Check out the examples below to find out how.

In this tutorial you will learn:
  • How to list, stop, and remove all Docker containers
  • How to remove Docker images, volumes, and networks

User management is an important part of Linux administration, so it's essential to know about all the user accounts on a Linux system. Some common user administration tasks are to list users, disable a user account, or create and modify user accounts.

In this guide, we will be focusing on managing user passwords. It's good security practice to force users to change their password every once in a while by setting passwords to expire. In the examples below, you'll see how to reset a user's password, set their password to expire (either instantly or in the future), and see the age of a user's password. We'll also see how password changes can be seen in log files, giving us some insight into user's password change history.

In this tutorial you will learn:
  • How to set a user's password to expire
  • How to see the age of a user's password
  • How to see password changes in log files

Most users, and especially administrators, of a Linux system will eventually run into the need to do some user account management. This may include adding or deleting a user from the system, or adding a user to a group and removing a user from a group.

In this guide, we'll show you the step by step instructions to add a user to a group on a Linux system. It's possible to add new users to a group when the new user is being created, or you can add existing user accounts to a group. This can be done through both GUI and command line. But the command line method will work exactly the same across any Linux distribution you may be running, including Ubuntu, Debian, Red Hat, CentOS, AlmaLinux, openSUSE, etc. We'll be covering both methods in this guide, so you can pick whichever option is most convenient for you.

In this tutorial you will learn:
  • How to add a new or existing user to a group from command line
  • How to add a user to a group from GNOME GUI

Managing the period of time a password of a user should be valid and the date in which said account should expire are very important tasks a system administrator should be able to perform. While some of these parameter can be set when creating an account, it is also possible to change them at a second time, using the chage utility; in this tutorial we see how to use this utility.

In this tutorial you will learn:

  • How to get information about an user account aging
  • How to set an account expiration date
  • How to set the minimum number of days which should pass between two password changes
  • How to set the password expiration date
  • How to set the inactive days threshold
  • How to set when a user should receive a warning about a future password expiration

The root account, sometimes called super user, is the admin account on a Linux system, and is essential for performing all kinds of administrative tasks. You'll need access to it in order to install or remove packages, manage other user accounts, and a lot more things. Anytime you access the root account, either through the su or sudo commands, you'll be prompted for the root password.

If you have forgotten the password to your system's root account, you don't necessarily have to go back to square one and reinstall the whole operating system. It's possible to recover and reset the root password, even without the old password. In this guide, we'll take you through the step by step instructions of recovering a forgotten root password on Linux. This will work regardless of the Linux distribution you're running, as long as its using the GRUB bootloader. Other bootloaders will have similar instructions.

In this tutorial you will learn:
  • How to reset a forgotten root password on Linux

When running an Apache web server on a Linux system, there may be some directories that you don't want everyone in the world to be able to access. Apache gives us a couple of different tools that website administrators can use to protect a directory.

One of the most common ways to configure restricted access to a folder is through the .htaccess file. Doing this configuration will prompt users for a password whenever they come across the protected URL. But we can also configure the same protection without .htaccess.

In this guide, we'll go over the step by step instructions for protecting a directory on an Apache web server, through two different methods. Follow along with us to get the password protection set up on your own website.

In this tutorial you will learn:
  • How to protect a directory using .htaccess file
  • How to protect a directory without .htaccess file

Archives compressed with gzip have the .tar.gz or .tgz file extension. It's easy enough to extract the contents from these files, but what if you only need a certain file? There's not much sense in extracting hundreds or thousands of files from an archive if you're only looking for a few files.

Fortunately, we can utilize the Linux command line and even GUI archive managers to search the contents of gzip compressed archives. Once we identify the file we want, it's possible to extract the file by itself, rather than extracting every single file.

In this guide, we'll show how to search one or multiple gzip archives for a particular file from both command line and GUI.

In this tutorial you will learn:
  • How to search the contents of a compressed gzip archive via command line
  • How to search the contents of a compressed gzip archive via GUI
  • How to search the contents of multiple gzip archives
  • How to extract a particular file from a gzip archive

One of the best ways to protect your files on a Linux system is to enable hard disk encryption. It's possible to encrypt an entire hard drive or partition, which will keep every file that resides there safe. Without the correct decryption key, prying eyes will only be able to see cryptic gibberish when they try to read your files.

In this guide, we'll go over the step by step instructions of using LUKS to encrypt a Linux partition. Regardless of what Linux distro you're running, these steps should work the same. Follow along with us below to get partition encryption configured on your own system.

In this tutorial you will learn:
  • How to install cryptsetup on major Linux distros
  • How to create an encrypted partition
  • How to mount or unmount encrypted partition
  • How to setup disk encryption during Linux install
How to configure, mount, and access encrypted partition on Linux
How to configure, mount, and access encrypted partition on Linux

It may be necessary to configure IP forwarding on a Linux system in certain scenarios. If the Linux server is acting as a firewall, router, or NAT device, it will need to be capable of forwarding packets that are meant for other destinations (other than itself).

Conversely, IP forwarding should usually be turned off if you're not using one of the aforementioned configurations. You typically don't want your system wasting bandwidth or resources to forward packets elsewhere, unless it's been designed to do that job.

In this guide, we'll go through the step by step instructions to enable or disable IP forwarding through command line examples. You can apply these commands to any major Linux distro, including popular choices like Ubuntu and Red Hat.

In this tutorial you will learn:
  • How to check the current IP forwarding status
  • How to enable or disable IP forwarding
  • Common troubleshooting steps for IP forwarding
Checking the status of IP forwarding and enabling the setting
Checking the status of IP forwarding and enabling the setting

Squid is a robust proxy server that supports caching for protocols like HTTP, HTTPS, and FTP. It has the ability to speed up web requests by caching frequently accessed websites, and serving that cache to requesting clients. This is a great way for networks to reduce bandwidth consumption and provide snappier response times for web browsing.

In this guide, we'll go over the step by step instructions to download, install, and configure Squid proxy on a Linux system. Follow along with us to get it setup on your own system, which can either provide caching just for yourself or all the way up to an entire organization of computers.

In this tutorial you will learn:
  • How to download and install Squid proxy on major Linux distros
  • How to configure Squid proxy
  • How to configure a browser to use Squid proxy

FIND LATEST LINUX JOBS on LinuxCareers.com
Submit your RESUME, create a JOB ALERT.
LINUX CAREER NEWSLETTER
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
DO YOU NEED ADDITIONAL HELP?
Get extra help by visiting our LINUX FORUM or simply use comments below.

You may also be interested in: