> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage template user environment

> The article explains how to manage default user environments in Linux using the `/etc/skel` directory for configuration files and welcome messages.

The skeleton directory `/etc/skel` provides the blueprint for every new user account on a Linux system. By placing files here, you ensure they are automatically copied into each new home directory—ideal for default configuration files, welcome notices, or policy reminders.

## Add a Custom Welcome Notice

To display a standard reminder or welcome message for all new users, create a file in `/etc/skel`:

```bash theme={null}
sudo vim /etc/skel/README
```

Insert your message, for example:

```text theme={null}
Please don’t run CPU-intensive processes between 8 AM and 10 PM.
```

Save and exit.

<Callout icon="lightbulb" color="#1CB2FE">
  Files placed in `/etc/skel` are automatically replicated to every new user's home directory. Use this to distribute common configurations or reminders.
</Callout>

## Verify Replication with a New User

Create a test user (e.g., `trinity`) to confirm the welcome notice appears:

```bash theme={null}
sudo adduser trinity
```

List all files, including hidden ones:

```bash theme={null}
ls -a /home/trinity
```

Expected output:

```bash theme={null}
.               .bash_logout  .profile
..              .bashrc       README
```

Display the notice:

```bash theme={null}
cat /home/trinity/README
```

## Customize the PATH for an Individual User

If a specific user needs a custom directory like `/opt/bin` in their `PATH`, update their `~/.bashrc`:

```bash theme={null}
sudo vim /home/trinity/.bashrc
```

Find the existing `PATH` line and prepend your directory:

```bash theme={null}
PATH="$HOME/.local/bin:$HOME/bin:/opt/bin:$PATH"
```

Save and close. When the user opens a new shell session, `/opt/bin` will be included:

```bash theme={null}
echo $PATH
```

Example:

```bash theme={null}
/home/trinity/.local/bin:/home/trinity/bin:/opt/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
```

Now `specialtool` in `/opt/bin` runs directly:

```bash theme={null}
specialtool
```

## Apply Default PATH Changes for All New Users

To make the custom `PATH` part of every future account, modify the skeleton `.bashrc`:

```bash theme={null}
sudo vim /etc/skel/.bashrc
```

Add your directory:

```bash theme={null}
PATH="$HOME/.local/bin:$HOME/bin:/opt/bin:$PATH"
```

Every user created after this change inherits the updated `PATH` automatically.

<Callout icon="triangle-alert" color="#FF6B6B">
  Be cautious when editing system-wide skeleton files. Incorrect settings in `/etc/skel` may affect all new user environments.
</Callout>

## Common Files in /etc/skel

| Filename      | Purpose                           |
| ------------- | --------------------------------- |
| .bashrc       | Interactive shell configuration   |
| .profile      | Login shell environment variables |
| .bash\_logout | Commands to run at logout         |
| README        | Custom welcome or policy messages |

***

## References

* [man skel - Linux manual](https://man7.org/linux/man-pages/man5/skel.5.html)
* [adduser command](https://linux.die.net/man/8/adduser)
* [Bash Reference Manual](https://www.gnu.org/software/bash/manual/bash.html)

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/linux-system-administration-for-beginners/module/7e2b6f48-e58c-4d05-82e2-feb0f5f876f5/lesson/29581ccd-25ee-4d70-b802-cc1ece802392" />

  <Card title="Practice Lab" icon="installation" cta="Learn more" href="https://learn.kodekloud.com/user/courses/linux-system-administration-for-beginners/module/7e2b6f48-e58c-4d05-82e2-feb0f5f876f5/lesson/fa4bc4e7-76bb-4161-9a55-7803ed67fd89" />
</CardGroup>
