{"api":"v1","endpoint":"/api/v1/documents/common-ubuntu-and-kubuntu-administrative-tasks-updating-users-firewall-and","generated_at":"2026-11-29T10:38:43Z","scope":"Published, public entries only. Bodies are Markdown; [n] markers cite the numbered sources.","data":{"slug":"common-ubuntu-and-kubuntu-administrative-tasks-updating-users-firewall-and","title":"Common Ubuntu and Kubuntu administrative tasks: updating, users, firewall and release upgrades","summary":"Step-by-step guide to four routine admin jobs on Ubuntu or Kubuntu 26.04 LTS: apt updates, user and sudo management, a ufw firewall, and a release upgrade. Every command is taken from Ubuntu or Kubuntu documentation.","kind":"guide","format":"guide","format_label":"Guide","topic":{"slug":"linux","name":"Linux"},"section":{"slug":"technical","name":"Technical"},"published_at":"2026-10-13T23:04:46Z","updated_at":"2026-10-13T23:04:46Z","read_minutes":9,"source_count":10,"url":"https://intel.innerpulse.net/doc/common-ubuntu-and-kubuntu-administrative-tasks-updating-users-firewall-and","api":"https://intel.innerpulse.net/api/v1/documents/common-ubuntu-and-kubuntu-administrative-tasks-updating-users-firewall-and","tags":[{"slug":"kubuntu","name":"Kubuntu"},{"slug":"ubuntu","name":"Ubuntu"},{"slug":"apt","name":"apt"},{"slug":"command-reference","name":"command reference"},{"slug":"how-to","name":"how-to"},{"slug":"release-upgrade","name":"release upgrade"},{"slug":"sudo","name":"sudo"},{"slug":"ufw","name":"ufw"}],"pdf_url":"https://intel.innerpulse.net/doc/common-ubuntu-and-kubuntu-administrative-tasks-updating-users-firewall-and.pdf","word_count":2133,"body":"By the end of this guide you will have brought an Ubuntu or Kubuntu 26.04 LTS machine up to date, created and managed user accounts, turned on the `ufw` firewall, and know how to move to the next LTS release safely. It is written for anyone administering a single desktop, laptop or server from a terminal. Kubuntu is Ubuntu with the KDE Plasma desktop, so the commands are identical. Where Kubuntu differs, the guide says so.\n\n## Before you start\n\n- **A supported release.** These steps follow the documentation for Ubuntu 26.04 LTS \"Resolute Raccoon\", released 23 April 2026 [7]. Kubuntu 26.04 LTS shipped the same day with Plasma 6.6 and kernel 7.0 [5]. Most commands also work on 24.04 LTS.\n- **An account in the `sudo` group.** By default the root account has no usable password. The first user the installer creates is a member of the `sudo` group and runs administrative commands with `sudo` [4].\n- **A terminal.** On Kubuntu this is Konsole. On Ubuntu Desktop it is Terminal. Over SSH it is your shell.\n- **A working internet connection**, and free disk space for the release upgrade (several gigabytes) [1].\n- **A backup** of anything you cannot afford to lose, before the upgrade stage in particular [1].\n- **If you use SSH:** a second open session before you touch the firewall (see Stage 3).\n\n> [!KEY]\n> From Ubuntu 25.10 onward `sudo` is provided by `sudo-rs`, a Rust rewrite. Ubuntu says most use cases work unchanged, but it is not 100% compatible with the original `sudo.ws` [4]. Everyday commands in this guide are unaffected.\n\n### Support windows at a glance\n\n| Release | Standard support ends | Notes |\n|---|---|---|\n| Ubuntu 26.04 LTS | May 2031 | Ubuntu Pro ESM to May 2036 [8] |\n| Ubuntu 24.04 LTS | May 2029 | Upgrade path to 26.04 LTS [8] |\n| Ubuntu 22.04 LTS | May 2027 | Must go to 24.04 first [8] |\n| Kubuntu 26.04 LTS | April 2029 | Flavour support is shorter than Ubuntu main [5][9] |\n| Kubuntu 24.04 LTS | April 2027 | [9] |\n\nUbuntu's own table and Kubuntu's page give different end dates for the same-numbered release. Kubuntu's three-year window is stated by the Kubuntu team [5]. Do not assume the Ubuntu date applies to the flavour.\n\n## Stage 1: Update and manage packages\n\n`apt` is the recommended tool for installing `.deb` packages [2]. Run all commands in a terminal.\n\n1. Refresh the package index:\n\n   ```bash\n   sudo apt update\n   ```\n\n   The index is built from the repositories listed in `/etc/apt/sources.list.d`. Ubuntu's own are in `/etc/apt/sources.list.d/ubuntu.sources`. Releases before 24.04 use `/etc/apt/sources.list` instead [2].\n\n2. Install the available upgrades:\n\n   ```bash\n   sudo apt upgrade\n   ```\n\n3. Install a package. The documentation uses `nmap` as its example. You can list several names separated by spaces:\n\n   ```bash\n   sudo apt install nmap\n   ```\n\n4. Remove a package:\n\n   ```bash\n   sudo apt remove nmap\n   ```\n\n   Add `--purge` to remove its configuration files too. The docs warn this may not be what you want [2].\n\n5. List installed packages, or find the package that owns a file, with `dpkg`:\n\n   ```bash\n   dpkg -l | grep apache2\n   dpkg -S /etc/host.conf\n   ```\n\n6. Install a downloaded `.deb` file only when no repository offers it:\n\n   ```bash\n   sudo dpkg -i zip_3.0-4_amd64.deb\n   ```\n\n   Ubuntu advises against `dpkg -r` for removal because it does not handle dependencies. Use `apt remove` instead [2].\n\n7. To review what `apt` did, read `/var/log/dpkg.log` [2]. Kubuntu's release notes say APT 3.2 in 26.04 also adds `apt history-list` and `apt history-rollback` [5]. I did not find a step-by-step official guide for these, so check `apt help` before relying on rollback.\n\n### Scripts and automatic updates\n\n`apt` is meant for interactive use. In scripts, use `apt-get` (optionally with `--quiet`). The basic syntax is the same [2]. Ubuntu Server applies security updates automatically by default [2].\n\n### Repositories\n\nUniverse and multiverse are enabled by default. Packages there get no security patches except through Ubuntu Pro's ESM, which is free for personal use on up to five machines [2]. To disable them, edit `/etc/apt/sources.list.d/ubuntu.sources` and remove `universe` and `multiverse` from the `Components:` line [2].\n\nOn Kubuntu, Plasma Discover also shows updates in the system tray, but the commands above work the same.\n\n## Stage 2: Manage users, groups and sudo\n\n1. List all local usernames:\n\n   ```bash\n   cat /etc/passwd | cut -d : -f 1\n   ```\n\n2. List only regular users (UID 1000 and above, plus `nobody` at 65534):\n\n   ```bash\n   cat /etc/passwd | cut -d : -f 1,3 | grep -E ':[0-9]{4,}'\n   ```\n\n   System users use UIDs 0–99 (pre-installed) and 100–999 (created by services). Regular users start at 1000 [4].\n\n3. Add a user and answer the prompts for password and full name:\n\n   ```bash\n   sudo adduser username\n   ```\n\n   The home directory is created from `/etc/skel`. On Ubuntu 21.10 and later it gets private `0750` permissions [4].\n\n4. Give that user administrator rights by adding them to the `sudo` group:\n\n   ```bash\n   sudo adduser username sudo\n   ```\n\n   This is the documented method: \"To give any other account full root access through `sudo`, add them to the `sudo` group\" [4].\n\n5. Create or remove a custom group:\n\n   ```bash\n   sudo addgroup groupname\n   sudo delgroup groupname\n   ```\n\n6. Temporarily lock or unlock a password:\n\n   ```bash\n   sudo passwd -l username\n   sudo passwd -u username\n   ```\n\n7. Delete a user and its primary group:\n\n   ```bash\n   sudo deluser username\n   ```\n\n   The home folder is not removed. To keep it but stop a future user with the same UID from reading it, the docs give these steps [4]:\n\n   ```bash\n   sudo chown -R root:root /home/username/\n   sudo mkdir /home/archived_users/\n   sudo mv /home/username /home/archived_users/\n   ```\n\n### Password ageing\n\n1. View a user's current policy:\n\n   ```bash\n   sudo chage -l username\n   ```\n\n2. Set the policy. This example, from the docs, sets a 5-day minimum age, 90-day maximum, 30 inactive days and a 14-day warning:\n\n   ```bash\n   sudo chage -m 5 -M 90 -I 30 -W 14 username\n   ```\n\n   The docs' example also sets an account expiry date with `-E`. Add it only if you want the account to expire [4].\n\n3. To raise the minimum password length from the default 6, edit `/etc/pam.d/common-password` and append `minlen=8` to the `pam_unix.so` line. This check does not apply when an administrator creates an account with `sudo` [4].\n\n### Restrict SSH to chosen users\n\n1. Open `/etc/ssh/sshd_config` and add `AllowGroups sshlogin`.\n2. Add each permitted user to that group, then restart SSH [4]:\n\n   ```bash\n   sudo adduser username sshlogin\n   sudo systemctl restart ssh.service\n   ```\n\n### Root account\n\nThe docs say you can set a root password with `sudo passwd`, and disable it again with `sudo passwd -l root` [4]. Most people should leave root disabled.\n\n## Stage 3: Turn on the firewall with ufw\n\n`ufw` is Ubuntu's default firewall front end and is **disabled by default** [3].\n\n1. If you are connected over SSH, allow SSH first so you are not locked out. Open a second session as a safety net:\n\n   ```bash\n   sudo ufw allow 22\n   ```\n\n   You can use the service name instead of the number if it is in `/etc/services`, for example `ssh` [3].\n\n2. Optionally preview a rule without applying it:\n\n   ```bash\n   sudo ufw --dry-run allow http\n   ```\n\n3. Enable the firewall:\n\n   ```bash\n   sudo ufw enable\n   ```\n\n4. Check the result:\n\n   ```bash\n   sudo ufw status verbose\n   ```\n\n5. Allow SSH only from one host, or a whole subnet by changing the address to `192.168.0.0/24`:\n\n   ```bash\n   sudo ufw allow proto tcp from 192.168.0.2 to any port 22\n   ```\n\n6. Use an application profile instead of port numbers. List the profiles, then allow one:\n\n   ```bash\n   sudo ufw app list\n   sudo ufw allow Samba\n   ```\n\n   Profiles live in `/etc/ufw/applications.d`. To see the ports a profile opens, run `sudo ufw app info Samba` [3].\n\n7. To remove a rule, list them with numbers, then delete by rule:\n\n   ```bash\n   sudo ufw status numbered\n   sudo ufw delete deny 22\n   ```\n\n   `sudo ufw insert 1 allow 80` places a rule at position 1 [3]. To close a port, `sudo ufw deny 22` is the documented form. Turn the firewall off entirely with `sudo ufw disable` [3].\n\n> [!WARNING]\n> The Ubuntu documentation page I read does not say what happens to existing SSH sessions when you run `ufw enable`, and I did not test it. Allow your SSH port before enabling.\n\n## Stage 4: Upgrade to the next release\n\nThis is different from routine updates. The upgrade tool moves you to the next major release [1].\n\n### Know your path\n\nYou can upgrade from one LTS only to the next sequential LTS. You cannot skip one [1]. Ubuntu's 26.04 notes add that anyone on 22.04 or 25.04 must first move to 24.04 LTS or 25.10 [7]. LTS-to-LTS upgrades are normally offered only after the first point release. The `-d` flag forces an earlier upgrade but is not recommended for production [1]. Kubuntu 26.04.1 is already published [9], so the normal route is open.\n\n```timeline\n[{\"date\":\"Apr 2024\",\"title\":\"24.04 LTS\",\"text\":\"Noble Numbat; standard support to May 2029 (Ubuntu) [8]\"},\n {\"date\":\"Oct 2025\",\"title\":\"25.10\",\"text\":\"sudo-rs becomes the default sudo [4]\"},\n {\"date\":\"23 Apr 2026\",\"title\":\"26.04 LTS\",\"text\":\"Ubuntu and Kubuntu release; Plasma 6.6, kernel 7.0 [5][7]\",\"highlight\":true},\n {\"date\":\"Apr 2027\",\"title\":\"Kubuntu 24.04 ends\",\"text\":\"Support date on kubuntu.org [9]\"}]\n```\n\n### Prepare\n\n1. Read the release notes for the version you are moving to [1][7].\n2. Fully update the current system. Phased packages can block the release upgrade, so include them [1]:\n\n   ```bash\n   sudo apt update\n   sudo apt dist-upgrade -o APT::Get::Always-Include-Phased-Updates=true\n   ```\n\n3. Check whether a reboot is needed. If this file exists, reboot first [1]:\n\n   ```bash\n   ls /run/reboot-required\n   ```\n\n4. Confirm there is enough free disk space, and set aside time. The upgrade is interactive and may take hours [1].\n5. Back up your data. Third-party repositories and PPAs are disabled during the upgrade, and they are the most common cause of problems [1].\n6. **Kubuntu only:** back up your KDE settings. This command comes from a third-party guide, not Kubuntu's own [10]:\n\n   ```bash\n   tar -czf ~/kde-config-backup-$(date +%Y%m%d).tar.gz ~/.config ~/.local/share\n   ```\n\n### Run the upgrade\n\n1. Start the tool:\n\n   ```bash\n   sudo do-release-upgrade\n   ```\n\n2. Read the summary of packages to be removed, installed and upgraded, plus the download size, then answer `y` to continue. After the download finishes, the process cannot be cancelled [1].\n3. When asked about a modified configuration file, press `D` to see the differences. The default, `N`, keeps your version. The docs say accepting the maintainer's version is sometimes required, for example `/boot/grub/menu.lst`, for the system to boot with the new kernel [1].\n4. When asked, choose whether to remove obsolete packages.\n5. Answer `y` to the restart prompt. The system is not considered upgraded until it reboots [1].\n\nOn Kubuntu, a third-party guide says the 24.04 to 26.04 upgrade also uses `do-release-upgrade`, and says NVIDIA driver 470 and older are incompatible with kernel 7.0 [10]. That claim is not in Kubuntu's own notes, so check your driver before upgrading.\n\n### After the upgrade (Kubuntu)\n\nKubuntu warns that upgraders may see visual glitches, broken panel layouts or misbehaving themes. Its fix [5]:\n\n1. Open **System Settings**, then choose **Colors & Themes**.\n2. Reapply your preferred global theme.\n3. When prompted, tick both **Desktop Layout** and **Window Layout**.\n\nIf that fails, Kubuntu's last resort is to back up and remove `~/.config`, which resets all Plasma settings [5]. Also note that the Plasma Wayland session is the default, and `plasma-session-x11` is available but not installed by default and not supported by the Kubuntu team [5].\n\n## Common problems\n\n| Problem | Fix |\n|---|---|\n| `apt upgrade` says \"packages have been kept back\" | Usually phased updates. The docs say you can safely ignore this and the update arrives automatically. Security updates are never phased [6]. |\n| Release upgrade refuses or stalls | Run `sudo apt update` and the `dist-upgrade` command in Stage 4 again. Check `/run/reboot-required` [1]. |\n| Software from a PPA vanished after upgrade | PPAs are disabled during upgrade. Re-enable them or find newer versions [1]. |\n| Release upgrade says no new release | LTS upgrades are offered after the first point release. The `-d` flag forces it but is not for production [1]. |\n| Config-file prompt during upgrade | Use `D` to compare. Keep yours by default, but accept the maintainer's file where it is needed to boot [1]. |\n| Locked a user's password but they still log in over SSH | Locking the password does not stop key-based SSH login. Remove or rename `~/.ssh/` and kill live sessions [4]. |\n| Deleted user's files are exposed to a new user with the same UID | `deluser` leaves the home folder. Use the `chown` and `mv` steps in Stage 2 [4]. |\n| Someone else's files are readable on an older install | Pre-21.10 homes were `0755`. Run `sudo chmod 0750 /home/username` and set `DIR_MODE=0750` in `/etc/adduser.conf` [4]. |\n| `sudo` behaves differently from old tutorials | 25.10+ uses `sudo-rs`. Switch back with `update-alternatives --config sudo`, though this is not recommended [4]. |\n| Broken Plasma panels or themes after upgrading Kubuntu | Reapply the global theme as in Stage 4. Only then consider resetting `~/.config` [5]. |\n| Spectacle OCR gives no text in your language | Install the Tesseract language pack, for example `sudo apt install tesseract-ocr-deu` [5]. |\n\n> [!DETAILS] Alternatives not covered here\n> - **Aptitude:** a text-menu front end. Install it with `sudo apt install aptitude`. The docs describe `+`, `-`, `u`, `U` and `g` keys [2].\n> - **IP masquerading with ufw:** needs edits to `/etc/default/ufw` and `/etc/ufw/sysctl.conf` [3]. It is not a routine task.\n> - **Kubuntu graphical upgrade:** I saw a Kubuntu community wiki snippet for an older release (`pkexec do-release-upgrade -m desktop -f DistUpgradeViewKDE`) but could not open the page, and no current Kubuntu 26.04 page confirms it. It is not included as a step.\n\n## Checked against\n\n- **Ubuntu 26.04 LTS (Resolute Raccoon)** release notes, dated 23 April 2026 [7], and Kubuntu 26.04 LTS release notes, dated 23 April 2026 (Plasma 6.6, kernel 7.0, APT 3.2) [5].\n- **Ubuntu Server documentation** pages for package management, firewalls, user management and release upgrades, as live on 13 October 2026. Search results dated two of them 26 June 2026 and the upgrade page 6 July 2026 [1][2][3][4].\n- Ubuntu's release-cycle page [8] and the Kubuntu download page, which lists 26.04.1 [9]. One third-party guide [10] was used only for the KDE backup command and the NVIDIA warning, which are marked as such.\n- Commands were taken from the pages above. I did not run them on a live system.","sources":[{"n":1,"title":"How to upgrade your Ubuntu release - Ubuntu Server documentation","site":"ubuntu.com","url":"https://ubuntu.com/server/docs/how-to/software/upgrade-your-release/"},{"n":2,"title":"Install and manage packages - Ubuntu Server documentation","site":"ubuntu.com","url":"https://ubuntu.com/server/docs/how-to/software/package-management/"},{"n":3,"title":"Firewall - Ubuntu Server documentation","site":"ubuntu.com","url":"https://ubuntu.com/server/docs/how-to/security/firewalls/"},{"n":4,"title":"User management - Ubuntu Server documentation","site":"ubuntu.com","url":"https://ubuntu.com/server/docs/how-to/security/user-management/"},{"n":5,"title":"Kubuntu 26.04 LTS Resolute Raccoon Released","site":"kubuntu.org","url":"https://kubuntu.org/news/kubuntu-26-04-release-notes/"},{"n":6,"title":"About apt upgrade and phased updates - Ubuntu Server documentation","site":"ubuntu.com","url":"https://ubuntu.com/server/docs/explanation/software/about-apt-upgrade-and-phased-updates/"},{"n":7,"title":"Ubuntu 26.04 LTS release notes","site":"documentation.ubuntu.com","url":"https://documentation.ubuntu.com/release-notes/26.04/"},{"n":8,"title":"Ubuntu release cycle","site":"ubuntu.com","url":"https://ubuntu.com/about/release-cycle"},{"n":9,"title":"Download | Kubuntu","site":"kubuntu.org","url":"https://kubuntu.org/download/"},{"n":10,"title":"Upgrade to Kubuntu 26.04 LTS, Step-by-Step Guide - Ubuntu Free (third party)","site":"www.ubuntufree.com","url":"https://www.ubuntufree.com/upgrade-to-kubuntu-26-04-lts/"}]},"source":"intel.innerpulse.net, a library of researched, cited reports. Please credit intel.innerpulse.net and link the entry you used.","docs":"https://intel.innerpulse.net/developers"}