# Running a task as different user

**URL:** <https://discuss.hashicorp.com/t/running-a-task-as-different-user/12049>\
**Category:** Nomad\
**Created:** [July 28, 2020, 3:52am UTC](https://discuss.hashicorp.com/t/running-a-task-as-different-user/12049 "2020-07-28T03:52:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![keith6014](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/keith6014/32/6630_2.png) [@keith6014](https://discuss.hashicorp.com/u/keith6014)\
**Post date:** [July 28, 2020, 3:52am UTC](https://discuss.hashicorp.com/t/running-a-task-as-different-user/12049/1 "2020-07-28T03:52:37Z")

</div>

I am running nomad server and client as root and I have a simple batch task which I would like to run as user “foo”.

So I did  
user = “foo”

But I get the error  
"failed to launch command with executor: rpc error: code = Unknown desc = container\_linux.go:349:starting container process caused “setup user: unable to find user foo: no matching entries in passwd file”.

The user foo is not in the passwd file because we get it from NIS. Is there another way around it?

If I do,

> getent foo

The user resolves.
