# Container (non-root) user can't write to /dev/stdout or /dev/stderr

**URL:** <https://community.fly.io/t/container-non-root-user-cant-write-to-dev-stdout-or-dev-stderr/10375>\
**Category:** General\
**Created:** [January 26, 2023, 5:50pm UTC](https://community.fly.io/t/container-non-root-user-cant-write-to-dev-stdout-or-dev-stderr/10375 "2023-01-26T17:50:28Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![ignoramous](https://avatars.discourse-cdn.com/v4/letter/i/a9adbd/32.png) [@ignoramous](https://community.fly.io/u/ignoramous)\
**Post date:** [January 28, 2023, 9:43am UTC](https://community.fly.io/t/container-non-root-user-cant-write-to-dev-stdout-or-dev-stderr/10375/12 "2023-01-28T09:43:30Z")

</div>

> [@tom93](#):
>
> ```auto
> cmd='whoami; ls -l /dev/stdout /proc/self/fd/1; echo "test" >>/dev/stdout'
> # su -s /bin/sh -c "$cmd" www-data >/tmp/out
> 
> ```

Will you pls explain what these two lines test? I can see that the string `test` wouldn’t append to `/tmp/out` (which is a regular file?), but have trouble understanding how `/tmp/out` became a `stdout` sink and why `/bin/sh -c ... >/tmp/out` didn’t (or isn’t expected to) truncate `/tmp/out`…?

* * *

> [@Alex21](#):
>
> But if there’s a way to launch an app/machine as the root user regardless of the user instruction that’s in the image, then doing that

Yes, via the `experimental` section of an app’s `fly.toml` ([docs](https://fly.io/docs/reference/configuration/#the-experimental-section), [ref](https://community.fly.io/t/unable-to-deploy-non-phoenix-elixir-app/2164/8)), or the `processes` section (where `app` is the default name for an entrypoint / main process on Fly):

> [@Change a containers CMD via the fly.toml file](https://community.fly.io/t/change-a-containers-cmd-via-the-fly-toml-file/2536/4):
>
> Thinking about it, I think the new preferred way to do this would be using the new [Preview: multi process apps (get your workers here!)](https://community.fly.io/t/preview-multi-process-apps-get-your-workers-here/2316). Something like: app = "your-app" [processes] app = "path/to/command arg1 arg2" By default, an app process will be infered if you don’t have one.

(unsure if `flyctl` commands for Machines / Apps v2 support `experimental` section, but it does support `processes` [ref](https://community.fly.io/t/fly-apps-on-machine-prerelease/10219)).

---

_[View the full topic](https://community.fly.io/t/container-non-root-user-cant-write-to-dev-stdout-or-dev-stderr/10375)._
