Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • For some reason, using crypt.mksalt does not work when generating passwords for /etc/shadow. But @Alex131089's method works! Commented Jul 22, 2017 at 16:32
  • Just wasted 1.5h trying this method, before I noticed the comment. Can somebody remove it? I can't downvote yet. Commented Sep 29, 2017 at 21:08
  • 2
    @MichałF it seems like this wasn't working because the salting wasn't done correctly. Thanks for pointing this out. I've removed the salt because the salting is dependent on OS and it's not practical to account for all ranges of OS in my answer. You should be using Method 1 outlined by @RahulPatil because it allows you to use salting and openssl is a pretty universal tool. Commented Sep 29, 2017 at 21:29
  • 1
    Not advisable, as it leaves your password in your shell history. Commented Mar 28, 2018 at 15:00
  • 1
    Provided a similar, but probably better answer here: stackoverflow.com/a/52096301/3628951 Commented Aug 30, 2018 at 11:50