LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices

Reply
 
LinkBack Search this Thread
Old 09-05-2004, 12:37 AM   #1
wayloud
Member
 
Registered: Jan 2003
Location: Seattle, Washington
Distribution: Red Hat, OpenBSD
Posts: 31

Rep: Reputation: 15
What is the encryption used for /etc/passwd FreeBSD 4.9


According to documentation my FreeBSD 4.9 system should be using MD5 encryption because the password field starts with $1$. However if I create a user with a password of "bob123" the hash entered in /etc/passwd doesn't match what I get when I simply do:

md5 -s bob123

Any thoughts? How can I veryify what encryption is being used, and is there a way to do it on the command line? Like in OpenBSD I can simply:

encrypt bob123

and I get output that is the same as what is in /etc/passwd.


Thanks
 
Old 09-05-2004, 01:59 AM   #2
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 69
Have you read the OpenBSD man page for encrypt(1)? The reason I ask is because it's doing more than just a one-way hashing algorithm. Read the man page to see why it's not that simple.

For FreeBSD you would need to also use the salt when md5'ing the password, but you have to remember it's crypt MD5 and not simply digest MD5. You won't get that behavior by using md5sum, you need to use something like the PERL module Crypt::PasswdMD5 or a call to the system function crypt(3) using the correct magic string to indicate hash type.

Last edited by chort; 09-05-2004 at 02:01 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
As a FreeBSD user, what is the best things you like about FreeBSD? t3gah *BSD 6 06-10-2005 02:38 PM
Mandrake 9.0 Wireless Works without encryption.. does not with encryption topcat Linux - Wireless Networking 3 05-04-2003 08:47 PM
freebsd 4.5 no root passwd ? Ratclaws *BSD 3 07-22-2002 03:28 PM
Anyone know anything about encryption? BrianK Linux - General 1 07-09-2002 10:55 PM
Encryption KingInk Linux - Security 1 03-29-2002 10:34 PM


All times are GMT -5. The time now is 08:28 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration