7 ways AI can help with your Linux system management


Linux AI terminal

Jack Wallen/ZDNET

Follow ZDNET: Add us as a preferred source on Google.


ZDNET’s key takeaways

  • AI has its place in the world of Linux.
  • If you’re new or über busy, AI can be a big help.
  • Employ AI in one of these areas to ease your burden.

I’m not a big fan of employing AI for everything. I strongly believe that it should have no place in creative endeavors (with some exceptions — such as DaVinci Resolve’s incredible AI voice isolation), but it does make sense to employ AI in certain areas.

For example: Linux system management. 

Before anyone gets up in arms, I’m not saying that system administrators should be replaced by machines. What I am saying is that AI can help those who are new to Linux learn how to manage (or better manage) their systems. And in cases where a single admin has to manage more machines than they have time for, AI can make for a great assistant.

But in what areas?

I’ve cobbled together seven uses where AI could really make a difference for those who are either very busy or who are just now learning the ins and outs of Linux.

1. Bash scripts

Although bash scripts aren’t a necessity for basic desktop Linux use, anyone who’s ever managed a Linux server or wanted to simply create a custom backup task for their desktops, bash scripts are essential.

For those who are just learning Linux, these scripts can be daunting, which is where AI can be handy. Using AI, you could type a prompt like, “Create a Linux bash script that backs up my ~/Documents directory to an external drive mounted at /backups on a daily basis and retains only the most recent five backups.”

Also: 5 factors steadily fueling Linux’s desktop rise

Your AI will create the bash script for you, which you can then test. If it works, cron that baby (another instance where you might need to use AI), and trust that your backups are going to be successful. Do make sure to check that they are not only working, but that the backups contain the files you want backed up. Because… you never know.

2. Parsing log files

Log files are key to understanding what’s going on with your system or what’s happened to your system. Most Linux log files are contained within /var/log, and some of them can be a bit challenging to understand. Here’s a good example. I recently ran into a syslog entry that I’d never seen before. Each entry contained “cause font doesn’t have a family name.” I did some DuckDuckGo’ing and found nothing. I then opened Opera’s Aria and queried it about the error. Turns out the error relates to font handling or rendering, and that the fonts in question do not have an essential attribute (in this case, a family name). Clearly, that’s not an error I need to worry about, so I decided to suppress those errors by creating a blacklist file in /etc/rsyslog.d/ with the contents:

:msg, contains, “cause font doesn’t have a family name” stop

I then restarted rsyslog with:

sudo systemctl restart rsyslog

Also: 5 surprisingly productive things you can do with the Linux terminal

The error was no more.

3. Understanding journalctrl output

Systemd can be a bit confusing at times, especially when it comes to errors. When you wind up with errors, you’ll be pointed to the journalctl tool, which can contain some really cryptic output. Most of the time, I can understand what it’s saying, but every so often, the journalctl output makes me go, “Huh?” When that happens, AI can be of assistance. 

Keep in mind that you shouldn’t just tell AI, “What does this output mean?” You should also include the app or service you are troubleshooting, as in, “What does this openssh-server journalctl output mean XXX” (where XXX is the actual journalctl output. 

AI is pretty good at helping you understand what you’re looking at.

4. Generating iptables firewall rules

Iptables is the foundation for all Linux firewalls, and man, can it be complex. It’s not often you have to bother with iptables, because you’d mostly be interacting with simpler counterparts, such as UFW. But if there is an occasion where you have to use iptables, you’ll very quickly realize how complicated it is.

Also: The first 5 Linux commands every new user should learn

I remember the first time I had to use iptables (back in the late 1990s), and I thought, “I’m never going to understand this!” Had I had AI to help me unravel the complexity of iptables, things would have been as easy as querying:

Write an IPtables rule to allow SSH connections in through port 2022 on the Ethernet device eth0.

Yeah, that’s so much easier.

5. Process monitoring

Although there are plenty of tools to help you monitor your Linux processes (especially some of the amazing and user-friendly GUIs), you might run into the rare occasion that you have to figure it out with nothing more than the command line. If you understand the ps command, you should be good to go; otherwise, consider querying your favorite AI:

How do I find out which process on a Linux system is using the most system resources, and how do I stop it?

The answer should get you started on your journey of keeping Linux system processes in check.

6. Managing user accounts and permissions

What if you needed to lock a user out of their account on a Linux system that includes agentic AI? You could always query:

Lock Mary out of her account for one week.

If the AI is configured with the proper permissions, you’ll most likely be asked to type your sudo password so the process can continue. After typing your sudo password, most likely your AI is going to run the command:

sudo chage -E $(date -d “+7 days” +%Y-%m-%d) Mary

Also: The best Linux distros for beginners

Because file/folder permissions can be a bit complicated to learn, you might use AI to help you out. This is especially easy on a system that includes agentic AI. With that, you could do something like:

Change the folder ownership and permissions of /data such that the group editors have full access to it.

7. Virtualization

Although you may never have to deal with virtual machines, there may come a time when you want to run a virtual machine in the background, so you have access to a particular server on your LAN, without having to have a GUI running 24/7. 

For example, you might have a virtual machine that runs Nextcloud to serve as your in-home solution for Google Workspace. Instead of running the VirtualBox GUI and then having the server GUI up and running (both GUIs take up valuable system resources), you could run it headless (which means without a GUI) so you can still access it from anywhere on your LAN. 

To that end, you could query:

How do I run a headless instance of a VirtualBox virtual machine named Nextcloud?

You’ll probably see the following in the output:

VBoxManage startvm “Nextcloud” –type headless

There are plenty of other ways you can use AI to help with Linux system management, and the above will easily get you started on that journey.





Source link

Leave a Reply

Subscribe to Our Newsletter

Get our latest articles delivered straight to your inbox. No spam, we promise.

Recent Reviews






Google is experimenting with a new policy restricting the amount of free storage provided to some accounts. New Google accounts (including new Gmail accounts) created in certain regions will be limited to 5GB of free storage when they’re first set up. That’s only one-third of the amount of storage that has been typically offered. There is a way of increasing the amount of free storage you get when setting up a new account, though: you can unlock it by linking your phone number.

When approached for comment by Android Authority, a Google spokesperson confirmed that the new policy was being tested to “help us continue to provide a high-quality storage service to our users, while encouraging users to improve their account security and data recovery.” The statement didn’t clarify which regions the policy is being tested in, nor for how long the testing period will last.

Notably, a Google One Help support page about account storage has been updated to state that each Google account contains “up to 15 GB of storage”, as noted by 9to5Google. Previously, the page didn’t say “up to”; it simply stated that accounts come with 15 GB of storage. So far, the experiment doesn’t appear to stretch to pre-existing accounts.

Per a screenshot shared by Reddit user Sungusungu on R/DeGoogle (a subreddit dedicated to finding alternatives to Google services and products) Google is collecting phone numbers to make sure that the full 15 GB of storage is only redeemed once per person. Of course, that’s easily evaded by using a burner phone to set up multiple accounts, should you want to. The pop-up directs users to a webpage to learn more about storage management. However, at the time of writing, the link redirects to the help center landing page instead.

How to link your Google account with a phone number

If you’re in the process of setting up a new Google account in an impacted region, then you might be prompted with the option of unlocking an extra 10 GB of storage using your phone number via a simple pop-up menu. If so, you can go ahead and follow those steps. However, if you want to link your phone number with a pre-existing Google account, then here’s what you need to do. Using your computer, you need to:

  1. Open your browser and head to myaccount.google.com, then navigate to “Security and sign in” on the left-hand toolbar. This should open a list of security options.

  2. Select “Use your phone to sign in” and then “Set it up”. 

  3. Add a phone number using the “Recovery phone” option.

  4. Follow the on-screen steps to verify your number and finish linking it to your account.

Your options might look a little different if you already have a recovery number set up with your account.

Alternatively, you can connect a phone number to your Google account from your Android device, iPhone, or iPad. Much like on a computer, you connect your number by adding it as a recovery phone. First, head over to myaccount.google.com. Then select “Personal info”, followed by “Phone”. From there, you should be able to add or edit your phone number by navigating to the “Recovery phone” section.





Source link