|
Bugzilla – Full Text Bug Listing |
| Summary: | Password Encryption: Yast Add User Uses MD5, Initial System Config Used SHA512 | ||
|---|---|---|---|
| Product: | [openSUSE] openSUSE 12.1 | Reporter: | andrew cooke <andrew> |
| Component: | YaST2 | Assignee: | Jiří Suchomel <jsuchome> |
| Status: | RESOLVED FIXED | QA Contact: | Jiri Srain <jsrain> |
| Severity: | Normal | ||
| Priority: | P5 - None | CC: | bruno |
| Version: | Final | ||
| Target Milestone: | --- | ||
| Hardware: | x86-64 | ||
| OS: | SUSE Other | ||
| Whiteboard: | |||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Attachments: |
Default values on a 12.1 system
Full var/log/YaST2 just after a Factory 12.2 installation |
||
|
Description
andrew cooke
2012-01-27 00:06:46 UTC
It's not only YaST : simple command line tools like useradd/passwd didn't setup the SHA512 encrypted password To reproduce, install 12.1 ensure that SHA512 is used. Setup a different normal user & root password check result userdel user useraadd user passwd user expected $6$xxxx found $1$1 Created attachment 473006 [details]
Default values on a 12.1 system
Default values are not setup correctly in /etc/default/passwd
rpm -qf /etc/default/passwd pwdutils-3.2.17-6.1.2.x86_64 c-3po:/etc/pam.d # rpm -q --changelog pwdutils-3.2.17-6.1.2.x86_64 * Mon Aug 29 2011 crrodriguez@opensuse.org - Fix build with new gnu LD. * Thu Jul 14 2011 lnussel@suse.de * add support for sha512 * use implicit defaults in /etc/default/passwd * use glibc's crypt_gensalt if available * Mon May 16 2011 kukuk@suse.de - Fix syntax errors in useradd.local * Wed May 11 2011 kukuk@suse.de - Update to pwdutils version 3.2.16 - sha512 new default password hash [FATE#312321]. - newgrp: honour dynamically assigned groups [bnc#680833]. - Don't link against libxcrypt what does your /var/lib/YaST2/users_first_stage.ycp say? > cat /var/lib/YaST2/users_first_stage.ycp
$[
"after_auth" : "users",
"autologin_user" : "",
"encryption_method" : "sha512",
"root_alias" : "andrew",
"root_password_written" : "1",
"run_krb_config" : "0",
"users_written" : 1
]
removing NEEDINFO on a 12.1 updated from 11.4 cat /var/lib/YaST2/users_first_stage.ycp $[ "after_auth" : "users", "autologin_user" : "", "encryption_method" : "blowfish", "root_alias" : "", "root_password_written" : "1", "run_krb_config" : "0", "users_written" : 1 ] on a 12.1 first installation $[ "after_auth" : "users", "autologin_user" : "", "encryption_method" : "sha512", "root_alias" : "", "root_password_written" : "1", "run_krb_config" : "0", "users_written" : 1 ] Do you have YaST log files from the installation? (see http://en.opensuse.org/openSUSE:Bugreport_YaST) don't you have a 12.1 of your own you can take these from? it was just a standard install. the entire log dump appears to contain a lot of information. i am not going to make a pile of unchecked info public. if you want one particular file i can read it and supply it. Okay this can also be reproduced on a pure factory 12.2 stock installation. Remove the use automatic setup enter a user with a password, then another passwd for root after the first reboot check cat /etc/password usertest:$6$JFXfHX77$LbUQdSJtjJVysC97vgpuEsNReS8JVYoerKsV5m4cGMk2Hp3ZzRTFG86Q9bmFXEFCxHnYvCChoUR4.AcOZX4/d/:15369:0:99999:7::: issue passwd usertest as root, then recheck shadow. usertest:$1$sjdNwIef$y3QkcSWoBVQMbzlq4iwiK1:15369:0:99999:7::: As I've just installed this vm this morning, I will add as attachement the whole var/log/YaST folder Created attachment 473259 [details]
Full var/log/YaST2 just after a Factory 12.2 installation
thanks (sorry for being so paranoid - but then, if i wasn't, perhaps i would not have found the bug :o). Thanks. This is an autogenerated message for OBS integration: This bug (743715) was mentioned in https://build.opensuse.org/request/show/102239 Factory / yast2-pam https://build.opensuse.org/request/show/102240 Factory / yast2-security https://build.opensuse.org/request/show/102243 Factory / yast2-security So, I've sent a fix to Factory (and 12.2). For 12.1, we cannot fix installation process anyway. Does it work for you when you change encryption method (at running system) from yast2 users or yast2 security? This is an autogenerated message for OBS integration: This bug (743715) was mentioned in https://build.opensuse.org/request/show/102267 Factory / yast2-users @Jiri - sorry, I don't understand what you want me to do. Where should I specify the encryption method? currently, /etc/default/passwd has CRYPT= so i assume it should use the default. but according to the post above the default should be sha512. so it is already configured correctly. I'm asking if the encryption can be changed using YaST. It could be done from YaST Users or YaST Security module. If there were bug also here, we'd need to release update, that's why I ask. Jiri, it seems to work manually under a 12.1, once in Yast2 security center -> password you set SHA512
then the /etc/default/passwd contain this
cat /etc/default/passwd
# This file contains some information for
# the passwd (1) command and other tools
# creating or modifying passwords.
# Define default crypt hash.
# CRYPT={des,md5,blowfish,sha256,sha512}
CRYPT=
# Use another crypt hash for group passwords.
# This is used by gpasswd, fallback is the CRYPT entry.
# GROUP_CRYPT=des
# We can override the default for a specific service
# by appending the service name (FILES, YP, NISPLUS, LDAP)
# for local files, use a more secure hash. We
# don't need to be portable here:
# CRYPT_FILES=sha512
#
# For NIS, we should always use DES:
# CRYPT_YP=des
# We can override the default for a special service
# by appending the service name (FILES, YP, NISPLUS, LDAP)
# for local files, use a more secure hash. We
# don't need to be portable here:
# CRYPT_FILES=blowfish
# sometimes we need to specify special options for a hash (variable
# is prepended by the name of the crypt hash). In case of blowfish
# and sha* this is the number of rounds
# blowfish: 4-31
# BLOWFISH_CRYPT_FILES=5
# sha256/sha512: 1000-9999999
# SHA512_CRYPT_FILES=1000
# In June 2011 it was discovered that the Linux crypt_blowfish
# implementation contained a bug that made passwords with non-ASCII
# characters easier to crack (CVE-2011-2483). Affected passwords are
# also incompatible with the original, correct OpenBSD
# implementation. Therefore the $2a hash identifier previously used
# for blowfish now is ambiguous as it could mean the hash was
# generated with the correct implementation on OpenBSD or the buggy
# one on Linux. To avoid the ambiguity two new identifier were
# introduced. $2x now explicitly identifies hashes that were
# generated with the buggy algorithm while $2y is used for hashes
# generated with the correct algorithm. New passwords are now
# generated with the $2y identifier.
#
# Setting the following option to "yes" tells the sytem that $2a
# hashes are to be treated as generated with the buggy algorithm.
BLOWFISH_2A2X=
CRYPT_FILES=sha512
then using Yast or useradd/usermod/passwd for users change the password for the desired format $6$
But any users, that have been created, need to change its actual password so it become re-encoded with the new format. That must be write in CAPITALS during the update.
For 12.1 update, perhaps the script could check if
CRYPT_FILES=md5
then replace it by
CRYPT_FILES=sha512
? Don't know if it's a good idea or not, +adding a comment #bnc743715
OK, so just in case anyone else reading this doesn't understand what is happening - it's clearer when you read all the comments in /etc/default/passwd. There the CRYPT variable is the default, but different services can be over-ridden. In this case, CRYPT_FILES, which is for "files" service (ie, shadow file) was being set to "md5" during install, which is the root cause of the bug. You can edit this by hand or via Yast's "security centre" - changing the default there changes the CRYPT_FILES value in default/passwd to "sha512". (In reply to comment #19) > Jiri, it seems to work manually under a 12.1, once in Yast2 security center -> > password you set SHA512 > then the /etc/default/passwd contain this > CRYPT_FILES=sha512 So this is correct and YaST works as it should on installed system. > For 12.1 update, perhaps the script could check if > CRYPT_FILES=md5 > then replace it by > CRYPT_FILES=sha512 > ? Don't know if it's a good idea or not, +adding a comment #bnc743715 No, that would not be good, as we could not know in script if the value is there by error or on purpose. So I think I can close it now: for 12.1, users can change the encryption value from YaST, and for next release, it should work well from the beginning. |