> For the complete documentation index, see [llms.txt](https://cajac.gitbook.io/ctf-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cajac.gitbook.io/ctf-notes/enum/linux-discovery/linux-user-enumeration.md).

# Linux User Enumeration

## List current username and groups

```bash
id
whoami
groups
```

## List all local users

```bash
cat /etc/passwd
```

## List user activity

Currently logged on users

```bash
who
```

Show currently logged on users and their activity

```bash
w
```

Show last logged on users

```bash
last
```

## References

**groups** - Linux manual page: <https://man7.org/linux/man-pages/man1/groups.1.html>

**id** - Linux manual page: <https://man7.org/linux/man-pages/man1/id.1.html>

**last** - Linux manual page: <https://man7.org/linux/man-pages/man1/last.1.html>

**w** - Linux manual page: <https://man7.org/linux/man-pages/man1/w.1.html>

**who** - Linux manual page: <https://man7.org/linux/man-pages/man1/who.1.html>

**whoami** - Linux manual page: <https://man7.org/linux/man-pages/man1/whoami.1.html>
