LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-03-2009, 11:14 AM   #1
bfzhou
Member
 
Registered: Feb 2008
Posts: 45

Rep: Reputation: 0
Cool how to set / change password encryption?


Hello,

I need to alter the current password encryption on my Fedora 9 linux system to something other than BLOWFISH, which could be causing problems with DB2.

but I don't even know which one I'm using. I anticipate alter this could be a risky endeavor as I risk losing access. Is this worry warranted?

Many thanks for any tip or insight.
 
Old 03-04-2009, 01:05 AM   #2
thedonkdonk
Member
 
Registered: Oct 2005
Location: San Jose, CA
Distribution: Fedora, RHEL, CentOS
Posts: 136

Rep: Reputation: 16
Hi.

A few things here. The first and big thing I want to ask is why do you think the password encryption is affecting DB2? What kind of errors are you seeing? I am using DB2 on RHEL 5 and I have not had issues with the password encryption. It uses the same password encryption by default as Fedora 9 which is shadow (http://en.wikipedia.org/wiki/Shadow_password).

If you really do need to change the type of password encryption (which I highly doubt) it is not the easiest thing to do but possible. You will always be able to boot to single user mode if your password does not work. The only potential data loss would be the current password for each user.
 
Old 03-04-2009, 01:50 AM   #3
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by thedonkdonk View Post
A few things here. The first and big thing I want to ask is why do you think the password encryption is affecting DB2? What kind of errors are you seeing? I am using DB2 on RHEL 5 and I have not had issues with the password encryption. It uses the same password encryption by default as Fedora 9 which is shadow (http://en.wikipedia.org/wiki/Shadow_password).

If you really do need to change the type of password encryption (which I highly doubt) it is not the easiest thing to do but possible. You will always be able to boot to single user mode if your password does not work. The only potential data loss would be the current password for each user.
Shadow isn't a password hashing system, don't confuse it with crypt().

Quote:
Originally Posted by bfzhou View Post
I need to alter the current password encryption on my Fedora 9 linux system to something other than BLOWFISH, which could be causing problems with DB2.

but I don't even know which one I'm using. I anticipate alter this could be a risky endeavor as I risk losing access. Is this worry warranted?
You should make sure it's causing problems, otherwise it probably is indeed unwarranted. Anyhow, you can check which encryption algorithm you are using by looking at the number between the dollar signs at the start of the second field in the relevant line of your /etc/shadow file (see the Wikipedia link for crypt() I posted above). For example, mine looks like:
Code:
win32sux:$1$BuZ4l/S5$HjFa4JFtQQO5C4pFTxpes/:14193:0:99999:7:::
Which means I am using the MD5 algorithm. To change the default algorithm, add (or edit) the ENCRYPT_METHOD line in your /etc/login.defs file. For example, to make all password hashes be SHA512 from now on, add a line like:
Code:
ENCRYPT_METHOD SHA512
Obviously you can't just add any algorithm, you need to make sure your distro supports it.

One way to check support is to look at the man page for chpasswd.

Last edited by win32sux; 03-04-2009 at 02:25 AM.
 
Old 03-05-2009, 08:26 AM   #4
bfzhou
Member
 
Registered: Feb 2008
Posts: 45

Original Poster
Rep: Reputation: 0
many thanks for the insight!

I encountered problem with db2 that although I can connect to the database without specifying user and password, the connection fails whenever I supplied userid and password explicitly, and got the error below, although I was using instance owner userid.

SQL30082N Attempt to establish connection failed with security reason "26" ("SERVER SECURITY PLUGIN ERROR"). SQLSTATE=08001

So DB2 support came back suspecting I was using BLOWFISH for password encryption, and suggest that I change it to DES. But I need to find out which encryption I'm currently using.

here's the entry in my /etc/shadow:
db2inst1:$6$zJBk96lz$q/C.HeodsK8N1IlbmmlAt5JnIpsc/u9DVm95Ko2QulvlCXq1qk8HcSbVaLQb10OnoYMbjGsz3KEKQcmXuhmls1:14308:0:99999:7:::

Does it say anything about whether it is BLOWFISH encription?

and here's the entry in /etc/login.defs
ENCRYPT_METHOD SHA512
 
Old 03-05-2009, 11:31 AM   #5
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by bfzhou View Post
here's the entry in my /etc/shadow:
db2inst1:$6$zJBk96lz$q/C.HeodsK8N1IlbmmlAt5JnIpsc/u9DVm95Ko2QulvlCXq1qk8HcSbVaLQb10OnoYMbjGsz3KEKQcmXuhmls1:14308:0:99999:7:::
The $6$ means you're using SHA512.
 
Old 03-09-2009, 04:23 PM   #6
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
Quote:
Originally Posted by win32sux View Post
The $6$ means you're using SHA512.
You probably want DES or MD5... although, I have some doubts that this is your actual problem.
 
Old 03-14-2009, 12:15 PM   #7
jstalewski
LQ Newbie
 
Registered: May 2006
Posts: 4

Rep: Reputation: 0
Note that if you change to DES you'll be limited to 8-character passwords. If DB2 supports longer passwords and can handle MD5, go for MD5.

Progress has the same problem with blowfish, and as with DB2 they recommend DES, which I chose to ignore as you're severely limited on password strength by the 8-byte limitation of DES-encrypted passwords. MD5 should work.
 
Old 07-27-2013, 02:37 PM   #8
mahakaal
LQ Newbie
 
Registered: Jul 2013
Posts: 2

Rep: Reputation: Disabled
Talking Simple

its chpasswd -C SHA512
(or any other ALGO)
 
Old 07-27-2013, 11:59 PM   #9
wsduvall
Member
 
Registered: Aug 2006
Posts: 92

Rep: Reputation: 16
Epic thread resurection.
 
Old 07-28-2013, 01:07 AM   #10
mahakaal
LQ Newbie
 
Registered: Jul 2013
Posts: 2

Rep: Reputation: Disabled
Yup.... :P
Just registered n saw the post.. proper answer not posted yet so replied...
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I change the default algorithm for password encryption dv502 Linux - Security 5 01-12-2009 06:54 PM
Script to change password in initially set as *LK* RaelOM Programming 5 08-13-2008 03:25 PM
change Root Password even if the password in the grub is also set sheelnidhi Linux - General 6 08-30-2006 07:27 AM
change password encryption to DES? (gentoo) gyost Linux - Security 0 02-15-2005 01:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 02:01 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration