Disable user password

172 views
Skip to first unread message

Roman Belyakovsky

unread,
Jun 4, 2014, 5:33:05 PM6/4/14
to salt-...@googlegroups.com
Let's say I want to disable password for some user. I can do this with "passwd -d someuser", I can do it with puppet in the following way:

user { 'someuser':
        comment => "no password user",
                password=> '',
}

But when I do the same in salt:

someuser:
  user.present:
  - password: ''

password doesn't become disabled. Here's how the /etc/sadow look for a disabled pass:
someuser::16213:0:99999:7:::
And for a smoker:
someuser:!:16225:0:99999:7:::

Is there a way to actually disable it with salt configuration?

Anna Berruezo

unread,
Jun 5, 2014, 7:25:35 AM6/5/14
to salt-...@googlegroups.com
I had the same issue and didn't know how to solve it.
I made it work with something like:

passwd -l someuser:
  cmd.run

I know it's not the way to do it, but at least it works.
(If somebody knows how to do it properly, I'd love to learn it too)

I hope it helps!

Colton Myers

unread,
Jun 10, 2014, 5:45:24 PM6/10/14
to salt-...@googlegroups.com
Could one of you open an issue on Github?  We should support this functionality.

--
Colton Myers


--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Roman Belyakovsky

unread,
Jun 10, 2014, 6:08:34 PM6/10/14
to salt-...@googlegroups.com
It’s already implemented by my colleague :

cmd.run is executed every time so it’s a dirty way.

Roman

You received this message because you are subscribed to a topic in the Google Groups "Salt-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/salt-users/67nFZ8Eri90/unsubscribe.
To unsubscribe from this group and all its topics, send an email to salt-users+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages