Setup and configuration

Handling the diagnosis with an AI (no sudo)

Ask an AI to handle the diagnosis: it investigates, and you run the commands it gives you for anything that needs sudo, checked against real output.

  • Level: Basics
  • About 20 min
  • 2026-11-25

#What to leave to the AI, and what to do yourself

Right after installing RoamSwitch, the diagnosis shows many findings. Instead of reading them one by one, you can ask an AI such as Claude CLI to "handle the RoamSwitch security diagnosis". The AI reads the diagnosis results and notifications through the MCP server for querying status from AI assistants.

What the AI can do is investigate and guide you on how to fix things. It does not run operations that need sudo. You read each command it gives you, understand what it does, and run it yourself. You do not need to set sudo to skip the password (NOPASSWD).

Assumption of this lesson

How to register RoamSwitch's MCP server with an AI client is in Connecting an AI client (MCP). This lesson assumes the AI runs as a user who cannot use sudo.

#How to ask, and what the AI did

The table below shows examples from asking Claude CLI as a user without sudo. The AI's answer changes from run to run, even for the same request.

SituationHow to askWhat the AI did
Many findings in the diagnosisHandle the RoamSwitch security diagnosisRead the diagnosis and notifications, and sorted the findings into "fixable now", "needs the OS to be rebuilt" and "can only be checked as root"
Many CVE warningsA large number of CVE warnings are showing. Handle themSplit the count into "needs action now" and "no fixed version yet"
The automatic update is failingIt says the kernel cannot be matched correctly. Handle itChecked the update record and the connection, and found that an earlier network failure was the cause
The meaning of a warning is unclearA container warning is showing. Handle itConfirmed that there is no container runtime and asked back "which warning?"
No web logIt says the web log path cannot be found. Handle itConfirmed that no web server is installed and answered that no action is needed

In every case, the AI did not change any setting. You can also check how the CVE count is split on the Matching packages against known vulnerabilities screen.

#Run the operations that need sudo, one at a time

Of the commands the AI gave, these 4 were run and checked before and after. The output was taken in an environment whose display language is English, so it stays in English.

Run the automatic update now

Run the Automatic updates of signed threat data update without waiting for the next scheduled time.

sudo systemctl start roamswitch-update.service
sudo grep -E '"lastSuccess"|"lastError"' /var/lib/roamswitch/updates.json
Output excerpt
  "lastSuccess": "2026-11-24T15:25:01.460816195+00:00",
  "lastError": null,

If lastError is null and lastSuccess shows a new time, the update succeeded.

Forbid running programs in /dev/shm

Of the findings under "noexec for /tmp and /dev/shm", fix /dev/shm.

sudo mount -o remount,noexec,nosuid,nodev /dev/shm
findmnt -no OPTIONS /dev/shm
roamswitch status | grep noexec
Output excerpt
rw,nosuid,nodev,noexec,inode64
   🔴 /tmp & /dev/shm noexec Hardening & Fileless Monitoring [ACTION] ⚠ No noexec: /tmp (not its own mount; part of the / file system)

Before the command, the diagnosis lists both /tmp and /dev/shm. After it, /dev/shm is gone and only /tmp remains. /tmp has no mount of its own, so a remount cannot fix it. You need to add a dedicated line to /etc/fstab. This remount returns to its old state after a reboot, so to keep the setting you also write it to /etc/fstab.

Make the authentication log readable

If you add the user who runs the AI to the adm group, that user can read the authentication log (/var/log/auth.log).

sudo usermod -aG adm tipuser
id tipuser
Output
uid=1002(tipuser) gid=1002(tipuser) groups=1002(tipuser),4(adm)

To apply it, log in again, then check with id that adm is in the groups. tipuser is the user name used in this exercise.

Read what a settings preset changes (no sudo)

Before applying the "Maximum security" preset of Settings presets (Light, Balanced, Standard security, Maximum security), read what it changes.

roamswitch preset show maximum | head -8
Output excerpt
  Settings preset
  Settings preset: Maximum security
      On top of Standard security, it also turns on the items that raise false positives, stop your work or talk to the outside: every protection that can be set is on. Before it is applied, you go through a caution for each item.

  Settings preset: Maximum security. Items that change (23)
    Exec recorder: automatic -> on
    Exec record retention (days): 14 -> 30
    Exec record retention (MB): 200 -> 500

Read which items change and from what to what, then decide whether to apply it.

#Points to keep in mind when reading the AI's answer

  • Even for the same question, the answer can change. Check figures and flat statements such as "there is no problem" on the diagnosis screen as well
  • The AI may guess your environment, for example which cloud you use. If a guess is wrong, correct it and continue
  • Run each sudo command one at a time, rerun the diagnosis after each, and see that the findings decrease
Guidance to a group that does not exist

The AI has sometimes told users to add themselves to a roamswitch group that does not exist, as in sudo usermod -aG roamswitch username. The package does not create this group. Before you run a command you were given, check that its target really exists, for example with getent group roamswitch.

What was checked, and what was not

Within what was checked on a disposable Ubuntu 24.04 VM:

  • Each of the 5 requests was run once. The answers can change every time, so the table is an example
  • Of the sudo commands, rerunning the automatic update, remounting /dev/shm and adding to the adm group were run and checked before and after. The preset check only reads
  • Not tried. Linux Mint, Codex, the server-only edition, a state where a container warning really appears (an environment with Docker), how the line added to /etc/fstab behaves after a reboot, and the result of running apt upgrade
  • Answers to the same question sometimes disagreed. For kernel CVEs, one run gave a count and another said "none apply". Check the count on the diagnosis screen
Check yourself

The diagnosis shows findings for noexec on /tmp and /dev/shm. After running sudo mount -o remount,noexec,nosuid,nodev /dev/shm, what is the right way to read the result?

Show the explanation

A remount returns to its old state after a reboot. While /tmp is part of /, a remount cannot add noexec to it.

Check yourself

The AI told you to run sudo usermod -aG roamswitch username. What should you do first?

Show the explanation

The package does not create a roamswitch group. Check that the target of a command you were given really exists before you run it.

#What to learn next

Features covered
What was verified

Verified on 2026-11-25. Target: Linux 2.6.11. On a disposable Ubuntu 24.04 VM (arm64, Linux 2.6.11, Claude CLI, a user without sudo), the AI was run once for each of 5 requests, and what it investigated and what it advised was recorded. Of the sudo commands it gave, rerunning the automatic update, remounting /dev/shm and adding to the adm group were run as the VM's administrator, and the output before and after was captured. The preset check was run without sudo.

Command output varies with the product version and the environment. If yours differs, check the version first.