Trending February 2024 # How To Protect Your Server With Fail2Ban In Linux # Suggested March 2024 # Top 2 Popular

You are reading the article How To Protect Your Server With Fail2Ban In Linux updated in February 2024 on the website Flu.edu.vn. We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. Suggested March 2024 How To Protect Your Server With Fail2Ban In Linux

Securing a server is a top priority for any business or organization. One of the most important tools in a sysadmin’s toolkit is Fail2Ban. This guide explains what Fail2Ban is and how you can use it to protect your Linux server from attacks.

Tip: in addition to Fail2Ban, check out these open-source tools to secure your server.

What Is Fail2Ban?

Fail2Ban is an intrusion prevention tool that monitors log files and bans IP addresses that show signs of malicious activity. It does this by creating “filters” that match certain patterns in the log files and executing actions, such as banning the offending IP address.

Why Use Fail2Ban? 

There are a few reasons to use fail2ban. It can:

save you time by automatically banning malicious IP addresses.

help to secure your server by reducing the chances of a successful attack.

give you peace of mind knowing that your server is being monitored and protected.

Installing Fail2Ban

By default, Fail2Ban is available in the Ubuntu repositories. Install it using apt.

sudo

add-apt-repository universe

sudo

apt update

&&

sudo

apt

install

fail2ban

-y

Fail2Ban will set its service in the background, but systemd will disable it by default. You can start and enable it with the following commands:

sudo

systemctl start fail2ban

sudo

systemctl

enable

fail2ban

Verify that Fail2Ban is running with the following command:

sudo

systemctl status fail2ban

You will see an output similar to the image below.

Configuring Fail2Ban

The “/etc/fail2ban” directory contains the configuration files for Fail2Ban. By default, Fail2Ban comes with a “jail.conf” file that contains settings that will apply to all services.

However, it is good practice to create a local “jail.local” file and override the settings in “jail.conf,” as you will lose any changes you make to “jail.conf” whenever the program updates.

You can create your “jail.local” file with the following commands:

sudo

cp

/

etc

/

fail2ban

/

jail.conf

/

etc

/

fail2ban

/

jail.local

Open the jail.local file to edit it:

sudo

nano

/

etc

/

fail2ban

/

jail.local

Good to know: learn how to create a SSH honeypot to catch hackers in your server.

Exploring the jail.local File

You will see a similar output as below and may be overwhelmed by the number of options available. But don’t worry, as we are walking you through the most important options.

The “[DEFAULT]” section contains the options applied to all jails. This is the global configuration for Fail2Ban. The following screenshot shows an example of this.

There are also other sections that start with the name of a service. This jail applies to a specific service over the top of the global jails.

For example, there is a section for “sshd” jail. This section contains the options that are specific to the sshd service.

Tip: you can also learn more about server hardening by securing your SSH server.

Enabling the Autoban Feature

Navigate to the “bantime = 1h” setting and remove the “#” symbol at the beginning of the line to enable it. This line sets the duration for how long Fail2Ban will disable an IP address. The default unit is one hour. You can also use other units, such as minutes(m), days (d), or even weeks (w).

You can increase or decrease this value as you see fit. For example, you can change this value to 30m to reduce the length of the ban to 30 minutes.

Changing the Default Login Window Length

The next settings are “maxretry” and “findtime.” They determine how many login attempts an attacker can do before Fail2Ban bans his IP.

The default values for “maxretry” and “findtime” are 5 and 10m. If an IP fails to authenticate five times in ten minutes, Fail2Ban will ban it for the duration specified by the bantime setting.

You can change these values to whatever you want. For example, you can set “maxretry” to 3 and “findtime” to 5m: Fail2Ban will disable an IP if it fails to authenticate three times in five minutes.

Enabling Fail2Ban’s Notification Feature

The next settings are destemail, sendername and mta. These settings are what Fail2Ban will use to configure email notifications.

The destemail setting is the email address where the program will send its notifications.

The sendername is the name that will show up in the “From” field of the notification email.

The mta is the mail transfer agent that Fail2Ban will use to send emails. The default mta is sendmail, but you can change it to something else like mail.

When a ban occurs, you will receive an email notification with details about the ban as shown.

Creating Custom Ban Commands

The next setting is “action_ =.” This determines the action that Fail2ban takes when it bans an IP address. The default action is to use iptables to block the IP until the “bantime” has passed.

You can also use other actions, as shown below. This tutorial sticks with the default for the sake of simplicity.

action_mw: sends an email notification when an IP is banned, attached with relevant WHOIS information.

action_mwl: sends an email notification when an IP is banned, attached with relevant WHOIS information and the log file entries that triggered the ban.

action_xarf: sends an email notification in the X-ARF format when an IP is banned with the log file entries that triggered the ban.

Many other actions are available, but it’s impossible to cover them all in this tutorial. You can read about all of the available actions in the Fail2ban documentation.

Enabling Service-Specific Configuration

Aside from configuring Fail2ban’s default behavior, it is also possible to use pre-made “filter files” for some of the common Internet services. These are small files that the developers wrote to look for specific log output of a particular server daemon.

For example, the “apache-shellshock.conf” file contains all of the necessary settings to allow Fail2ban to check for any malicious attempts to create the shellshock bug.

You can find all the available filter files for your system by listing the “/etc/fail2ban/filter.d” directory:

ls

/

etc

/

fail2ban

/

filter.d

Once you know the filters that you want to use, tell Fail2ban to load them during startup by opening your “jail.local” file:

Add the filters that you want to activate. For example, the following is an excerpt that I use in my configuration:

[

sshd

]

enabled =

true

[

nginx-bad-request

]

enabled =

true

[

bitwarden

]

enabled =

true

[

INCLUDES

]

Once done, save and close the file. Restart fail2ban to apply the changes.

sudo

systemctl restart fail2ban Testing Your Configuration

Now that you have configured fail2ban, it’s time to test it.

The simplest way to test your configuration is to try to log in with an incorrect password multiple times in quick succession. You can use an SSH connection to do this.

On a disposal machine, try to SSH into your Fail2ban server using an “admin” username. Replace “your_server_ip_address” with the actual IP address of your Fail2ban server.

ssh

admin

@

your_server_ip_address

Enter a random password when prompted and repeat it a few times. After a few attempts, you will see a message that the server refused your connection attempt.

Aside from using ssh, you can also test the other filter files in Fail2ban by triggering their “fail state.” In my case, I am using the “nginx-bad-request” filter that detects whether there is a host that’s flooding the server with invalid requests.

Knowing that, you can test this feature by deliberately sending empty requests to your web server using curl:

Verifying Fail2ban’s Actions

Finally, run the below command on your Fail2ban server to verify that fail2ban has added the necessary rules to iptables.

The grep command filters the output of the iptables command. The -S option tells iptables to print the rules in a format that can be easily parsed.

Tip: you should also make use of SELinux to secure your Linux server.

Frequently Asked Questions Why do I get an empty email notification when Fail2ban bans an IP address?

If you get an empty email notification, it’s likely that you have not configured your mail server correctly. Check the configuration of your mail server and make sure that it’s able to send email.

How do I view the fail2ban log file?

You may want to view the fail2ban log file to troubleshoot issues or to see why an IP was banned. The “/var/log/fail2ban.log” file contains all of the logs generated by fail2ban. Use the cat command to view the fail2ban log file: cat /var/log/fail2ban.log.

I enabled multiple filter files. Why are all of them not working?

This issue is most likely caused by a filter overwriting a different file that came before it. One way to fix this is to create your own filter file by combining multiple filters together.

Image credit: Unsplash. All alterations and screenshots by Ramces Red.

Ramces Red

Ramces is a technology writer that lived with computers all his life. A prolific reader and a student of Anthropology, he is an eccentric character that writes articles about Linux and anything *nix.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Sign up for all newsletters.

By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time.

You're reading How To Protect Your Server With Fail2Ban In Linux

How To Revive Your Ipod With Rockbox In Linux

If you owe an old iPod and are running Linux on your computer, you can use Rockbox to breathe life to your old music player. It enables you to use your iPod without iTunes while also improving on the default sound quality of the iPod. Rockbox is also customizable and really easy to install. Here we will show you how to use Rockbox in Linux.

What is Rockbox and Why Install It

Rockbox is an operating system for classic iPods. It is an open source alternative to the iPod’s default software and it aims to improve on the original system’s deficiencies.

In order to achieve that, Rockbox includes a better API for third-party applications as well as high resolution audio support. This means that, unlike the original, it is possible to run games and use higher quality codecs such as FLAC, Ogg Vorbis and Opus with your iPod.

Not only that, Rockbox is constantly up-to-date with modern audio technologies. For example, it supports a Parametric Equalizer to allow you to adjust and balance your headphones.

Lastly, Rockbox also has features such as Binaural Crossfeed and Gapless Playback. This can be useful if you are listening to classical or live music where concert albums are often split as separate tracks.

Which iPods Are Compatible with Rockbox

One important thing to note, however, is that Rockbox is not available for all iPod models. At the moment, it only supports up to the sixth generation of the original iPod and the first two generations of the iPod Nano and Mini.

This means that you will not be able to install Rockbox on either an iPod Touch or iPod Shuffle. The reason is because these models either use an entirely different firmware or operating system.

How to Obtain Rockbox

Obtaining Rockbox is incredibly simple. To do that, you can go to their releases page where you can pick between an Automatic and Manual installation.

The Automatic option uses a program that was created to streamline the entire installation process. It’s meant to reduce the amount of guessing that you might have to do and potential errors that you might encounter while installing. Because of that, the Automatic option recommended method by the Rockbox community.

On the other hand, the Manual option provides you with a set of archives that you can download and extract to your device’s root folder. This gives you the most amount of flexibility during installation and it can also be useful if you are using an operating system that the installer does not yet support.

How to Install Rockbox in Linux

First, make sure that Ubuntu would be able to run the installer. Run the following command to make the installer executable:

Detecting Your iPod in the Utility

The “Device Configuration Prompt” is a small window that allows you to tell the Rockbox Utility about your specific music player. In order to do that, you need to first connect your iPod to your machine through USB.

Once connected, the “Device Configuration Prompt” will attempt to automatically detect your music player. However, this feature does not always work. In order to fix this, you can press the “Autodetect” button to force the utility to redo the check.

Setting up the Rockbox Configuration Utility

From there, you can choose between four different functions in the utility. For the most part, you will only need to check either the “Installation” or the “Backup & Uninstallation” tab.

The “Installation” tab manages all of the components that you can install to your device. In here, you can choose to install fonts, themes as well as plugins and programs. Not only that, you can also update your current bootloader here.

The “Backup & Uninstallation” tab allows you to manage the snapshots that you made as well as the option to wipe your device clean. This can be useful if you are either writing plugins or you want to turn your device back to stock.

Install Rockbox to Your iPod

First, you need to go to the “Installation” tab. From there, pick the version that you want to install from the drop-down menu. In my case, I selected the “Stable Release” version of Rockbox.

Once done, check the boxes for the parts of Rockbox that you want to install to your device. Some of the components in the list are optional. For example, it is not necessary to include the fonts, themes and manuals to be able to have a working installation.

Note: it’s good practice to install all the components listed in the utility. This is to ensure that your device has all the files that it needs to run. This will make updates easier later on.

From here, the Rockbox device should automatically mount itself as a normal USB drive. You should now be able to add music and files to your iPod as if it is a regular MP3 player.

Backing Up and Removing Rockbox

It is also possible to use the utility to create a backup of your current installation as well as completely uninstall Rockbox. Not only that, the process of doing either one of those is incredibly simple.

Backing Up Your Installation

Doing that will, in turn, open the “Rockbox Backup Prompt”. In this, the utility will display the current size of your installation as well as an option to select where you want to save your archive. In my case, I will leave the options to their default settings.

With that, the backup utility will then compile all of the Rockbox files in a single archive. Once done, it will then provide a small prompt telling you that the backup has been successful.

Uninstalling Rockbox from your iPod

Similar to creating a backup, you need to go to the “Backup & Uninstallation” tab to remove Rockbox in your device. Once there, you can then choose between two removal methods for your iPod:

The first option only removes the bootloader from your installation. Doing this will turn your iPod back to stock but it will not remove the Rockbox files inside your device. This is only useful if you intend to update your system to a newer Rockbox build.

The second option removes all of the associated Rockbox files from your device. This is the option to completely wipe your device clean.

In my case, I will choose the second option since I want to completely remove Rockbox from my iPod.

From there, the utility will then display a small prompt where you can choose between “Complete” and “Smart Uninstallation”. As described above, in order to fully remove Rockbox you will need to select the “Complete Uninstallation” option.

Frequently Asked Questions Is it possible to use Rockbox for players other than the iPod?

Yes, you can certainly install Rockbox on other music players. It is possible to install Rockbox on almost all of the Sandisk Sansa players as well as iRiver’s H-series of devices.

Once done, you can go back to the utility’s “Installation” tab and pick the “Development Branch” in the version drop-down menu. From there, you then need to select and install both the bootloader and firmware components for your device.

Is it possible to switch back to the stock iPod without removing Rockbox?

Yes! Due to its design, Rockbox only overlays itself on top of the original device’s firmware. This means that, the factory firmware files are still present in the device.

To switch back to the stock iPod, toggle the iPod’s lock switch on immediately after cold booting. Doing this will, in turn, tell Rockbox to disable itself and directly pass the control back to the original firmware.

One important thing to note, however, is that you will not be able to access any files that you placed in the iPod through Rockbox while running the original firmware. This is mostly due to the fact that the original iPod uses a proprietary database format that only the iTunes program understands.

Ramces Red

Ramces is a technology writer that lived with computers all his life. A prolific reader and a student of Anthropology, he is an eccentric character that writes articles about Linux and anything *nix.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Sign up for all newsletters.

By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time.

How To Transcode Flac Files With Flac2All In Linux

flac2all is a simple utility that allows you to convert high-quality FLAC files to almost any modern audio format. Unlike ffmpeg, this utility automates the process of sorting, tagging and encoding your FLAC audio. flac2all is easy to install and use. Learn how to use this highly versatile program that can act as a front end for all your audio transcoding needs.

Why Use flac2all

At its core, flac2all is both a wrapper and a scheduling program. It takes a list of FLAC files and uses various codecs to queue and manage the transcoding process.

Lastly, flac2all also preserves the folder structure of your FLAC collection, so you do not need to redo the directory of your archive while using this program. These features make flac2all a handy utility if you are looking for a quick and easy way to recreate your FLAC collection in a different format.

Installing flac2all

Before you install flac2all, it’s important to obtain all of its dependencies to ensure that there will be no conflicts after installation:

sudo

apt

install

python3 flac python3-pip python3-zmq python3-notcurses

lame

opus-tools

The next thing to do is to download flac2all through pip, a Python-specific package manager that you can use to install additional software. Run the following command to use pip:

pip3

install

--user

flac2all

This will install flac2all to the current user’s “.local” directory. So if you are on a multi-user system, other users will not be able to run the program.

In order to run flac2all, include your “.local” directory to your machine’s PATH variable by adding the following line of code to your “.bash_profile” file:

PATH

=

$PATH

:

/

home

/

$USER

/

.local

/

bin

/

export

PATH

Lastly, either restart or log out of your current session to apply the new settings, after which you can run flac2all -h to confirm that you have properly installed the program.

Using flac2all to Transcode Audio

The developer of flac2all designed the program to be as simple as possible. For example, the syntax for transcoding a FLAC directory to a single format looks like this:

flac2all mp3

-o

.

/

output .

/

royalty-free

The first element after “flac2all” highlights the format that you want to transcode to. I am converting my FLAC folder to MP3 in this example.

The second element contains options for the current transcode job. Here, the -o option tells flac2all to send any MP3 files to the “output” folder.

Lastly, the third element indicates the source folder for your FLAC files. In my case, it is my “royalty-free” folder.

Transcoding to Multiple Formats

You can also use flac2all to transcode files to multiple formats in parallel, which can be useful if you want to transfer your archive to players with different format requirements.

For example, I can run the following command to transcode my “royalty-free” folder to both MP3 and Opus:

flac2all mp3,opus

-o

.

/

output .

/

royalty-free

Note that a multiple-format transcode will take longer than a single-format transcode because flac2all will encode each file in your directory for every format that you specify. In my case, transcoding MP3 and AAC will take twice as long as only transcoding MP3.

Creating Custom Transcode Jobs

Aside from creating simple transcodes, it is possible to tweak how the encoders behave with flac2all, which is especially helpful if you want the copy of your archive to be of a certain audio quality. Look at the following command, for example.

flac2all mp3

--lame-options

=

'b 320'

-o

.

/

output .

/

royalty-free

This command tells the program to use the LAME MP3 encoder to transcode my “royalty-free” folder at a constant bitrate of 320k.

You can also create custom jobs for multi-format transcodes. For example, the following command tells flac2all to create a custom transcode with MP3 and Opus:

flac2all mp3,opus

--opus-options

=

'downmix-mono'

--lame-options

=

'b 320'

-o

.

/

output .

/

royalty-free Creating a flac2all Transcode Cluster

While you can use flac2all on a single computer, it is also possible to spread the program across multiple systems – a practical solution to speed up the transcoding process. Ensure that you have the following resources ready:

Two or more machines that can directly connect to each other

A NAS that you can access across all machines because the master flac2all process only instructs its worker clients to process existing data

A reliable network connection between the master process and its worker clients

Knowing these factors, this tutorial will focus on creating a small flac2all cluster between two Ubuntu 22.04 machines.

Setting Up a Network Mount

Create a network storage mount to begin. For this, I am going to use SSHFS since it is easy to use and available to almost all Linux distributions.

To start, install SSHFS on all of the machines that you want to use:

sudo

apt

install

ssh

sshfs

Next, create the folder to which SSHFS will mount. I will create a “royalty-free” folder in the home directory of my worker machine:

mkdir

/

home

/

$USER

/

royalty-free

Now mount the “royalty-free” directory to each of your worker machines with the following command:

sshfs

-o

allow_other,default_permissions

$USER

@

192.168.68.10:

/

home

/

$USER

/

royalty-free

/

home

/

$USER

/

royalty-free Starting the flac2all Cluster

You can now start the transcoding cluster by running the master process and adding both -m and -C flags to flac2all.

For example, run this command on your main machine to create a master process:

flac2all

lame

,aac

-m

-C

--lame-options

=

'b 320'

-o

/

home

/

$USER

/

output

/

home

/

$USER

/

royalty-free

Unlike regular flac2all, creating a master process will not start the transcoding session. In order to transcode files, you also need to connect the workers to the master process by running the following command on your worker machines:

flac2all_worker 192.168.68.10

Once done, the worker client will create a headless process that connects to the master program. After that, flac2all will start immediately once it finds a handful of workers on standby.

Frequently Asked Questions flac2all does not terminate after processing my audio files. How do I fix this issue?

This happens whenever there is a conflict with flac2all and its Python dependencies. Fix it by updating your installation to reflect any changes between flac2all and its dependencies. Run pip install --user --upgrade flac2all to upgrade flac2all.

flac2all is throwing a “FileNotFound” error. Is my installation broken?

No! This problem occurs when the program fails to detect the encoder for the format to which you want to transcode.

For example, running flac2all opus […] without the Opus encoder will result in a “FileNotFound” error. You can fix the issue by installing ffmpeg. This is a catch-all program that will also install most of the common audio encoders. Run sudo apt install ffmpeg to add ffmpeg to your system.

The worker process failed to find any media in my SSHFS mount. Is flac2all broken?

No. This usually happens due to a directory mismatch between the master process and its workers. To ensure that the transcode cluster works, check that the file paths between each machine are the same by running pwd on both your media folder and the root of your SSHFS mount.

Image credit: Unsplash and Wikimedia Commons All alterations and screenshots by Ramces Red

Ramces Red

Ramces is a technology writer that lived with computers all his life. A prolific reader and a student of Anthropology, he is an eccentric character that writes articles about Linux and anything *nix.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Sign up for all newsletters.

By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time.

How To Benchmark Your Linux System

In the world of consumer electronics, benchmarks are everything. More than specs, or anecdotal accounts, and certainly more than marketing materials, benchmarks give you meaningful information about the capabilities of a given piece of hardware, be it a single subsystem—like a PC’s GPU—or several subsystems in concert.

Unfortunately, many common benchmarks (especially those built into games) only run in Windows. Cinebench, PCMark, 3DMark, and CrystalDiskMark are popular Windows tests, but have no Linux equivalent.

If you go out looking for PC benchmark results, there’s a very strong chance the tests won’t perfectly translate to performance under Linux, since they were likely run in Windows. This is particularly true if certain hardware has limited support in the Linux kernel. However, there are still plenty of tests you can run in Linux, and the vast majority of them are free.

Testing in Linux

Linux users can find an easy-to-use test for their systems in the Gnome Disks utility, which comes with both the Gnome 3 and Ubuntu’s Unity desktops. Though the utility is most often used to administer disk partitions and software RAID, it features a built-in benchmark. It’s pretty basic, but will suffice for a general overview. Simply search for Disks in Ubuntu’s dash (or Gnomes Activities panel) to find the utility.

The Disks utility benchmark running on the Gnome 3 desktop.

A quick search for benchmark in Ubuntu’s Software Center will yield a few interesting entries. The first will likely be the System Profiler and Benchmark application. This program is really useful for getting detailed system information via a GUI, but the benchmarks are a bit lacking and not necessarily indicative of real-world usage. There are six benchmarks total, all of which test the CPU. 

There are several entries for benchmarking tools in Ubuntu’s Software Center.

The System Profiler application leaves a lot to be desired in the benchmarking 

The best part of PTS is the automation. Tests and suites are all defined in XML files that you can edit as you see fit. If you mess up while creating a custom suite on the command line, don’t worry about it; you can simply open the suite XML file located in the folder ~/.phoronix-test-suite/test-suites/local. When you run a test or suite for the first time, PTS will attempt to fetch the test for you. If a test requires a dependency, PTS will let you know, but will still allow you to continue. If the dependency is not installed, the test that requires it will not run.

Phoronix Test Suite will attempt to download and install the test software the first time it runs.

Testing with the Dell XPS 13 Developer Edition

To show off what PTS can do, I ran a custom suite of tests on a 2024 Dell XPS 13 Developer Edition that came preloaded with Ubuntu Desktop 14.04 LTS.

To create the suite, I first installed Phoronix Test Suite, which required the packages php5-cli and php5-gd. Once PTS was installed, I created my suite using the command phoronix-test-suite build-suite. PTS presents a list of all the supported tests. Most of the tests are free to use, but some require purchase (mostly retail games like BioShock: Infinite), which I avoided.

My completed suite consists of 10 tests (though some tests run multiple times with different settings) that I felt reflect an average desktop experience. For instance I chose IOZone to test the read and write performance of storage devices; Unigen’s Heaven to test graphics performance; RAMspeed for memory; various encoding and decoding tests; a Linux kernal compilation; a test for file compression; and one for encryption.

Once I added all of the tests I wanted, I saved and exited, but left the terminal window open. Just to make sure everything was on the up-and-up, I opened the XML file to look for typos or tests that I might have added in error.

PTS graphs the results of the individual tests in a suite.

If you’re interested, you can check out the final results at openbenchmarking.org.

Once you have your benchmark results, you can use them as a baseline. When you swap hardware or make tweaks to your system settings, run the exact same tests again to measure the impact of that change. 

A few notes about benchmarking

Running benchmarks can seem straightforward at first, but there are plenty of things that can throw off your results. First off, it’s a good idea to keep a PC plugged in, as opposed to running on battery; turn off any power-saving options; and turn off its hibernate and sleep functions for the plugged-in power profile while running tests. (The exception would be if you’re specifically performing a battery run-down test.) It’s also a good idea to close any other open applications to maximize the RAM and CPU resources available for testing. If performing tests on your storage devices, make sure they have ample free space for the test files.

How To Use “Find My” To Protect And Track Your Iphone

For many iPhone owners, the worst-case scenario is losing their device. When this happens, all your photos, contacts, apps and data all lost together with it. Fortunately, Apple’s upgraded “Find My” app comes with new features to help you find your phone.

How to Set Up Find My iPhone in iOS 15

If you are new to the iPhone or have never set up your Find My app yet, this can become confusing. While the app used to be called “Find My iPhone,” it is now simply “Find My.” However, using it on your iPhone is an option called “Find My iPhone.” Let’s see how to set that up.

Go to the Settings app on your iPhone, tap on your name, then “Find My.”

At the very top, tap on “Find My iPhone” and make sure it is toggled on.

Assuming you are already on iOS 15, you will also have the option of “Find My network,” which will help you locate your iPhone even if it is offline.

Tap on “Send Last Location,” a helpful feature that will send your location to Find My if your iPhone battery is about to die.

How to Share My Location with Others

Once you’ve enabled Find My, you have a number of options available with iOS 15, including the ability to share your location with friends and family.

You may need to share your location individually. Ensure this has been done by tapping on each person’s name. If you see “Stop Sharing My Location,” you know your location is being shared.

As soon as this is toggled on, anyone on your Apple Family account can see your location.

If you want to expand your location sharing to people in your contact list, you can do that as well.

Start by opening the “Find My” app and open the “People” tab. Tap on the “+” sign directly at the top right of the pop-up menu.

Tap on “Share My Location” and choose the name of the contact you wish to share your location with. Alternatively, you can manually enter their email address or phone number.

Tap on “Send” and choose how long you would like to share your location.

If you want to stop location sharing altogether, it’s very easy to do from inside the Find My app.

Enter the app and disable “Share My Location” and all location-sharing will be off.

Should you prefer to stop sharing with a particular person, tap the people tab at the bottom of the app and choose the appropriate contact.

Tap “Stop Sharing My Location.”

How to Track a Lost iPhone

Initially, the best way to locate a missing iPhone is to use the Find My app.

You have a few options: making the device play a sound, turn-by-turn directions to its location, adding a message to the lost device asking for it to be returned, lock the device so anyone who finds it cannot access it, and erasing all of the data.

In the event you don’t have another Apple device that has the Find My app installed, chúng tôi is the next best option.

Apple doesn’t offer the same set of options here as you will on a device like an iPhone, iPad or Mac. However, between Play Sound, Lock and Erase iPad, you should be able to take the necessary steps to locate a lost device.

How to Use Someone Else’s iPhone to Locate Yours

If your iPhone is lost and you can’t access another device or chúng tôi you can turn to a friend or family member for help.

On the other person’s iPhone, open the Find My app, then tap on the “Me” option at the bottom right of the screen.

At the bottom of this screen is now an option for “Help a Friend.”

Have your friend follow the on-screen directions, which include signing in to iCloud using their Apple ID to see and locate their lost device.

The other person can tap on Play Sound to locate the iPhone if it’s nearby or tap on Lost Mode to protect the data on the iPhone and activate low power mode to allow for a larger search window. They can also choose to erase the iPhone.

How to Locate an iPhone that Is Offline

This is perhaps one of the biggest iOS 15 changes to Find My. It’s important to know that the offline feature only works on the iPhone 11 lineup and above. Once this feature is active, you will know it’s available the next time you power down your iPhone and see the message “iPhone Findable After Power Off.”

All of the available steps like placing the iPhone in “Lost Mode,” playing a sound or using directions will be available. You can also set the device to erase the next time it’s powered on.

How to Use Lost Mode

Let’s take a deeper look at “Lost Mode.”

Once you activate Lost Mode, a number of steps will happen:

To disable Lost Mode:

Do note that should you recover your device, Lost Mode will disable itself as soon as your passcode is entered on the device.

How to Turn Off Find My

While Find My has critical importance to locate a missing device, there may be a time you will want to disable it.

iPhone, iPad and Mac

On any iPhone, iPad or iPod touch, the steps to disabling Find My are all the same:

It’s that simple. If you’re on a Mac,

Apple Watch

With an Apple Watch, the most important step to disable Find My is to unpair it from your iPhone. Doing so will erase any contents, remove Activation Lock and delete any payment card information for Apple Pay. To unpair your Apple Watch:

AirPods

With AirPods, the steps are pretty straightforward to remove from your Find My device list. You just need to unpair your AirPods from your Bluetooth settings on all of the devices they are connected to. This could include Apple TV, an iPod, Mac, iPad, etc.

On the Mac:

AirTags

Disabling AirTags is just as easy as one might expect, requiring only a few taps to remove them from an Apple ID.

Using the iPhone, iPod or iPad, open the Find My app and locate “Items” in the menu at the bottom of the screen.

Bring your AirTag close to your iPhone or iPad if possible.

Tap on “Remove Item” and follow the remaining on-screen instructions.

What About Separation Mode?

Another new function of iOS 15 (and iPadOS 15) is the introduction of “Separation Alerts.” The name pretty much explains what this feature will do, but once enabled, your iPhone, Pad, iPod touch, Apple silicon or macOS Monterey hardware will let you know if it’s been left behind. This feature isn’t only for Apple devices, as you can activate Separation Mode for just about anything.

Start by opening up the Find My app on your iPhone, iPad, or Mac. Tap on “Devices” at the bottom of the screen, then tap again on the intended device.

Toward the middle of the screen, below “Notifications,” you will see “Notify When Left Behind.” Toggle this option on, then follow the onscreen instructions.

You can also add a “Trusted Location,” such as your home or office, so you have a little flexibility for a range of motion. Tap on “New Location” and add as many addresses as you see fit.

In the case of AirTags:

Tap on “Items” at the bottom of the Find My screen, then “Notify When Left Behind” and toggle on.

Add a trusted location by selecting the location on a map and tapping “Done.”

Tap on “Done” a second time, and AirTags will be enabled for separation alerts. Place them in a backpack, purse, suitcase, etc.

Frequently Asked Questions 1. Should I attempt to locate a missing iPhone by myself?

This is likely the most important aspect of using Find My. No, you should absolutely not attempt to locate a missing iPhone if it appears to be in a home or office building. Should you have any concerns about where an iPhone may be if it went missing or was stolen, contact local authorities to help.

2. Is it safe to use someone else’s iPhone or iPad to locate my device?

Yes, absolutely. Apple makes sure you are protected by ensuring you are using your Apple ID to help locate your device. Also, make sure you log out after you are done locating your device, and you shouldn’t have any security concerns.

3. If I erase my iPhone thinking it’s lost, can I restore it?

Yes, but only if you have a recent iCloud backup. Just restore your iPhone as you normally would after disabling Lost Mode.

Wrapping Up

Losing your iPhone or any device is a heartbreaking experience. Our devices have become such an integral part of our life that we almost can’t remember what we did before smartphones. Fortunately, Apple has helped develop multiple steps to ensure that in the worst-case scenario, there are built-in protections for its users to locate and recover lost devices.

If you just bought a new device, learn how to transfer your data to a new iPhone or iPad.

David Joz

David is a freelance tech writer with over 15 years of experience in the tech industry. He loves all things Nintendo.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Sign up for all newsletters.

By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time.

How To Set Up Your Own Linux Photo Management System With Lychee

Ever wanted to access your photos from anywhere via the Web but didn’t want to sign up for proprietary solutions like Google Photos, Photo Bucket, etc.? Introducing Lychee, a self-hosted tool that allows users to manage, upload and catalog their large photo collections. It runs on any web server that has Apache2 (or NGINX), PHP and MySQL.

In this tutorial we’ll be using the Ubuntu server. This is not to say that Lychee will not run on other Linux server operating systems. The instructions are essentially the same, minus a few package changes. Just make sure you have MySQL, the latest PHP and Apache2 (or Nginx).

Hardware Requirements

a Linux server distribution that has the ability to run and install snapd

any moderately-powerful old desktop PC (DDR-2 era or better) that can stay on at all times and act as a server

a VPS or any other type of enterprise-grade server

Installing Ubuntu Server

Go to Ubuntu’s website and download the latest version of Ubuntu Server. After downloading it, make a live installation tool with Etcher. Follow the instructions on the website. Using it is a three-step process. Alternatively, burn the Ubuntu disc image to a DVD or CD.

The Ubuntu Server installation disk is loaded. As a result, a selection menu appears with several options. Select “Install Ubuntu Server” to move onto the installation.

On the next page Ubuntu server asks the user to select the correct language. Using the arrow keys, find your language, then press Enter.

Next, set a hostname for Ubuntu server. Name it “ubuntu-lychee,” “ubuntu-server,” “ubuntu,” or something similar. This is mainly to identify the device on the network from other computers.

Add a username to the server as well as a memorable, secure password.

After setting the username, Ubuntu server brings up the partition manager. Using the arrow keys, select “guided – use entire disk” and press the Enter key. This will allow Ubuntu Server to automatically partition everything.

After the base-installation, Ubuntu server prompts the user to select packages to install. Using the arrow keys to hover over an option, press the spacebar to select. Select LAMP server, standard system utilities and OpenSSH server. Then, wait for the installation to complete. When the installation is finished, restart the machine.

Note: installing the LAMP server package will prompt you to add a MySQL root password. Enter a secure, memorable one as it will come in handy later.

Installing Lychee

First, log into MySQL with the root password set up earlier.

mysql

-

u root

-

p

This will give you root access in MySQL. Now create the Lychee database.

create

database

lychee

;

Then, change the permissions on the database; add a database user and password.

GRANT

ALL

PRIVILEGES

ON

lychee.

*

TO

lycheeuser@

'localhost'

IDENTIFIED BY

'ReplaceWithPasswordHere'

WITH

GRANT

OPTION

;

Lastly, flush the privileges, and exit MySQL.

flush

privileges

;

quit

Create an Apache2 configuration file.

sudo

nano

/

etc

/

apache2

/

sites-available

/

lychee.conf

Paste the following:

DocumentRoot

/var/www/html/Lychee/

Options

Indexes

FollowSymLinks

MultiViews

AllowOverride

All

Order

allow

,

deny

allow

from

all

sudo

service apache2 restart

Install git, some PHP addons and grab the Lychee code.

sudo

apt

install

git

php-cli php-gd php-mysqlnd php-curl php-json php-zip php-exif php-session php-mbstring

Once the installation is done, go to the Apache web folder:

cd

/

var

/

www

/

html

/

Grab the Lychee code:

cd

Lychee

For user: lycheeuser

For database: lychee

For password: enter the password that was set during the database creation process.

Using Lychee

Create Album

Import Via Link

Other Ways to Import

Conclusion

Online photo management has gotten better in the last few years, but there really hasn’t been many good self-hosted, easy-to-use alternatives Linux users can use – until now. That’s why I’m glad Lychee is around, as it makes it easy for anyone to set up their own online photo system that rivals something that Google or Microsoft would come up with.

Derrik Diener

Derrik Diener is a freelance technology blogger.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Sign up for all newsletters.

By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time.

Update the detailed information about How To Protect Your Server With Fail2Ban In Linux on the Flu.edu.vn website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!