2024-05-09 12:33:27 +00:00
# Jailmaker Docs
Anything described on this page is completely optional. You do NOT need to do anything of this in order to start using jailmaker.
## User Management
2023-10-03 12:24:43 +00:00
The root user (also known as the superuser or su) can access any file, make system changes, and lots of room for security vulnerabilities.
For this reason you should aspire to run services as a non-root user.
### Create a non-root user
`useradd USERNAME`
Where username can be anything, but should reflect the service/jail's name for diagnostic.
Then a password should be created as some commands require a non-blank password to be inserted:
`passwd USERNAME`
2024-05-09 12:33:27 +00:00
If you want the ability to run commands as root, add the user to the sudo group:
```sh
usermod -aG sudo USERNAME
```
2023-10-03 12:24:43 +00:00
This WILL require a non-blank password, and any command run with sudo will be run as root not as the user. But it saves time compared to switching users to root to install/change things then switching back.
### Switch to user
2024-05-09 12:33:27 +00:00
```sh
su -l USERNAME
```
2023-10-03 12:24:43 +00:00
### Put a password on Root
2024-05-09 12:33:27 +00:00
While logged in as root run `passwd` .
## Common Tweaks
2023-10-03 12:24:43 +00:00
### Update repository list
2024-05-09 12:33:27 +00:00
```sh
sudo apt update
```
2023-10-03 12:24:43 +00:00
### Install common services
2024-05-09 12:33:27 +00:00
```sh
sudo apt install nano wget curl git
```
2023-10-03 12:24:43 +00:00
### Set Static IP
2024-05-09 12:33:27 +00:00
See [Networking ](./network.md )
### Colorized bash prompt
To visually distinguish between a root shell inside the jail and a root shell outside the jail, it's possible to colorize the shell prompt. When using a debian jail with the bash shell, you may run the following command **inside the jail** to get a yellow prompt inside the jail (will be activated the next time you run `jlmkr shell myjail` ):
```bash
echo "PS1='${debian_chroot:+($debian_chroot)}\[\033[01;33m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '" >> ~/.bashrc
2023-10-03 12:24:43 +00:00
```
2024-05-09 12:33:27 +00:00
### Install Docker
It's advised to use the [docker config template ](../templates/docker/README.md ). But you can install it manually like this as well:
```sh
2023-10-03 12:24:43 +00:00
apt install curl & & cd /tmp & & curl -fsSL https://get.docker.com -o get-docker.sh & & sudo sh get-docker.sh & & cd ~ & & docker
```