Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Thanks, that's all I needed to know. I was hoping there would be some way of doing this directly from bash, but going for the perl method is not a problem.
As rweaver pointed out, and I'm not too big to admit, I was wrong.
I may have mentioned this before, but it looks like my version of mkpasswd doesn't have flags such as "hash". I've got flags to define the minimum number of special characters and so forth, but not hash type. Where did you guys get your mkpasswd package?
Copyright (C) 2001-2004 Marco d'Itri
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
But, if you can't get mkpasswd to do what you need, there is still the perl script
I looks like my mkpasswd command is part of the "expect" package, so I'm guessing that maybe your mkpasswd is different than mine. My mkpasswd doesn't even have a "-V" option.
I think I'll have to settle with the perl script, then.
I may have mentioned this before, but it looks like my version of mkpasswd doesn't have flags such as "hash". I've got flags to define the minimum number of special characters and so forth, but not hash type. Where did you guys get your mkpasswd package?
Strange, do a man on mkpasswd, you may have --hash but not md5 (aes, blowfish maybe?)
Strange, do a man on mkpasswd, you may have --hash but not md5 (aes, blowfish maybe?)
You can try this:
mkpasswd --hash=help
and it should display any available.
Yeah, it's strange. I don't have any hash option at all - I've searched the man page, and I've entered your command above. Is your mkpasswd part of another package, or did is come as a separate package?
Yeah, it's strange. I don't have any hash option at all - I've searched the man page, and I've entered your command above. Is your mkpasswd part of another package, or did is come as a separate package?
I've got three systems in front of me that I just checked, it's in my base install on all of them, strangely enough it seems to be coming from the "whois" package O_o. Although at one time I'm almost positive it came from the "bsdutils" package.
I've got three systems in front of me that I just checked, it's in my base install on all of them, strangely enough it seems to be coming from the "whois" package O_o. Although at one time I'm almost positive it came from the "bsdutils" package.
I guess I'll have to accept that we simply have to different implementations of mkpasswd, and yours is definately superior.
At least I know where to find yours if I need it later on. Thanks for the help anyway.
$ mkpasswd -V
GNU mkpasswd 4.7.20
Copyright (C) 2001-2004 Marco d'Itri
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
rweaver, I'm curious -- what version do you have?
kenneho, I assume that "no -V" means no "--version" or other equivalent.
I do seem to have hashing, but not md5:
Code:
$ mkpasswd -h
Usage: mkpasswd [OPTIONS]... [PASSWORD [SALT]]
Crypts the PASSWORD using crypt(3).
-H, --hash=TYPE select hash TYPE
-S, --salt=SALT use the specified SALT
-P, --password-fd=NUM read the password from file descriptor NUM
instead of /dev/tty
-s, --stdin like --password-fd=0
-h, --help display this help and exit
-V, --version output version information and exit
If PASSWORD is missing then it is asked interactively.
If no SALT is specified, a random one is generated.
If TYPE is 'help', available algorithms are printed.
Report bugs to <md+whois@linux.it>.
buttertoast:~# mkpasswd -V
GNU mkpasswd 4.7.20
Copyright (C) 2001-2004 Marco d'Itri
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
buttertoast:~# mkpasswd --help
Usage: mkpasswd [OPTIONS]... [PASSWORD [SALT]]
Crypts the PASSWORD using crypt(3).
-H, --hash=TYPE select hash TYPE
-S, --salt=SALT use the specified SALT
-P, --password-fd=NUM read the password from file descriptor NUM
instead of /dev/tty
-s, --stdin like --password-fd=0
-h, --help display this help and exit
-V, --version output version information and exit
If PASSWORD is missing then it is asked interactively.
If no SALT is specified, a random one is generated.
If TYPE is 'help', available algorithms are printed.
Report bugs to <md+whois@linux.it>.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.