How to check all the roles and services in ubunutu

the most common ways to inspect services and roles on Ubuntu.

1. Services (systemd)

Modern Ubuntu uses systemd to manage services.

List all services and their status

bash

systemctl list-units --type=service --all

Show only active (running) services

bash

systemctl list-units --type=service

Check a specific service

bash

systemctl status <service-name>

Example: systemctl status ssh

List services that start on boot

bash

systemctl list-unit-files --type=service

Legacy service command (still works)

bash

service --status-all
  • + means running
  • - means not running
  • ? means status unknown

2. User Roles, Groups, and Permissions

See what groups your current user belongs to

bash

groups

See groups for a specific user

bash

groups username

List all users on the system

bash

cat /etc/passwd

Or more readable:

bash

getent passwd

List all groups on the system

bash

cat /etc/group

Or:

bash

getent group

Check sudo / admin privileges for your user

bash

sudo -l

This shows what commands you are allowed to run with sudo.

Check if a user has sudo access

bash

sudo -l -U username

3. Quick Summary Table

What you wantCommand
All servicessystemctl list-units --type=service --all
Running servicessystemctl list-units --type=service
My groups / rolesgroups
All system usersgetent passwd
All system groupsgetent group
My sudo permissionssudo -l

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top