Results 1 to 4 of 4

Thread: creating md5 password

  1. #1
    Join Date
    Sep 2007

    creating md5 password

    Hello all,

    I know my question may look silly but how do you create md5 passwords in Ubuntu? With my old Slackware, I just used to type:

    crypt password_in_clear_text
    and it returned me the md5 encoded version that I could simply copy-paste to /etc/passwd if I wished so (or feed it to other scripts or even an ldif file to use with ldapadd, for instance). I think it was a perl script, but wouldn't bet on it.

    But I've tried this on my new Ubuntu (10.04) and got an error message explaining that crypt was not present on the system and that I should install the mcrypt package. Alas! This package is deemed buggy and unmaintained, by its very description in the repository. O^o

    Google search left me in the impression that each tool (slapd, grub, perl...) had its own function to do this. But I didn't find anything generic to the system, which I find quite disturbing and awkward.

    So, please, is there an official way to get md5 passwords from clear-text ones in command line?

  2. #2
    Join Date
    Nov 2005
    Bordeaux, France
    Ubuntu 12.04 Precise Pangolin

    Re: creating md5 password

    There is no "official" way, whatever that means. You can use makepasswd:

    firas@tsukino ~ % echo "foo" | makepasswd --clearfrom - --crypt-md5
    foo          $1$STwTCV9d$KoEL8Fj/r.a2aqQRoBlZz1
    Also, such passwords should be copied in /etc/shadow, not /etc/passwd, and MD5 is not really considered secure anymore.
    Last edited by Bachstelze; June 28th, 2010 at 02:52 PM.

  3. #3
    Join Date
    Sep 2007

    Re: creating md5 password

    Quote Originally Posted by Bachstelze View Post
    Also, such passwords should be copied in /etc/shadow, not /etc/passwd
    Doesn't work on a NIS server, as far as I know. Not that NIS could be considered secure, of course.

    Anyway, merci beaucoup.

  4. #4
    Join Date
    Apr 2008

    Re: creating md5 password

    An alternative:
    echo "mypass" |md5sum

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts