# Created user with chef.But i am not able to login

**URL:** https://discourse.chef.io/t/created-user-with-chef-but-i-am-not-able-to-login/11341
**Category:** Chef Infra (archive)
**Created:** [August 16, 2017, 6:57pm UTC](https://discourse.chef.io/t/created-user-with-chef-but-i-am-not-able-to-login/11341 "2017-08-16T18:57:19Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sunilkumar](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@sunilkumar](https://discourse.chef.io/u/sunilkumar)
#### Post date: [August 16, 2017, 6:57pm UTC](https://discourse.chef.io/t/created-user-with-chef-but-i-am-not-able-to-login/11341/1 "2017-08-16T18:57:19Z")

</div>

Hi Guys,

I created a user with chef using user resource in chef docs but when i try to switch the user iam getting error.  
Finally i came to know when i give password manually iam able to login but when i give password using chef resource getting error…Please give me the exact syntax how to create and assign a password for the user in linux.

---

<div class="post-metadata">

### Author: ![majormoses](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/majormoses/32/1999_2.png) [@majormoses](https://discourse.chef.io/u/majormoses)
#### Post date: [August 18, 2017, 4:54am UTC](https://discourse.chef.io/t/created-user-with-chef-but-i-am-not-able-to-login/11341/2 "2017-08-18T04:54:50Z")

</div>

A couple things to check:

- `ruby-shadow` installed? `/opt/chef/embedded/gem install lib-shaddow`
- create the sha of the password rather than passing the actual password via `openssl passwd -1 "theplaintextpassword"` or `mkpasswd -m sha-512`

There are some more complex modes that are all found here: [https://docs.chef.io/resource\_user.html](https://docs.chef.io/resource_user.html)
