Setting up fog password fails on clean new CentOS 7 install
-
Trying to setup FOG from scratch in a complete new VM with CentOS 7 (fully updated) the installer failed with:
* Setting up fog user.........................................OK * Setting up fog password.....................................Failed!
Looking into what’s going on I found that
passwd
seams to be unhappy with reading the password input from a file. At first I thought this might be an issue because I am running the script via SSH but trying the same on the console is still giving me the same error:$ cat tmppass mypassword mypassword $ passwd fog <tmppass Changing password for user fog. New password: Password change aborted. New password: Password change aborted. New password: Password change aborted. passwd: Have exhausted maximum number of retries for service
So far I have no idea why it works when running it through a pipe instead of reading it straight vom stdin… anyone an idea?
$ cat tmppass | passwd fog Changing password for user fog. New password: BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word Retype new password: passwd: all authentication tokens updated successfully.
-
The only thing that comes to mind is that there is unprintable characters in the text file that cat is either removing (or adding) to allow the passwd to accept. I’m thinking LF vs CR LF characters.
This IS an interesting situation.
The question would be is this a centos 7 specific issue or is this a passwd problem.
-
Is anyone able to verify this on his/her CentOS system?? Doing the same thing on Debian is working like a charm… both ways!
$ passwd fog <tmppass Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully $ cat tmppass | passwd fog Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
-
@Sebastian-Roth I’m not using a CentOS fog server right now, but I am using Fedora and not seeing any issues. I’ll see if I can replicate on my CentOS 7 box though.
-
I have both centos 6 and 7 I can test one give me a minute to finish my first cup of coffee.
-
Here is on centos 7
$ uname -a Linux turbodog 3.10.0-327.10.1.el7.x86_64 #1 SMP Tue Feb 16 17:03:50 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux $ vi tmppass $ passwd gof <tmppass Changing password for user gof. New password: Retype new password: passwd: all authentication tokens updated successfully. $ cat tmppass | passwd gof Changing password for user gof. New password: Retype new password: passwd: all authentication tokens updated successfully.
Here is for centos 6.7
$ uname -a Linux mudbug 2.6.32-573.18.1.el6.x86_64 #1 SMP Tue Feb 9 22:46:17 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux $ vi tmppass $ passwd gof <tmppass Changing password for user gof. New password: Retype new password: passwd: all authentication tokens updated successfully. $ cat tmppass | passwd gof Changing password for user gof. New password: Retype new password: passwd: all authentication tokens updated successfully.
In both cases it appears to work as intended.
-
Centos7 storage node test
[root@fogstoragenode ~]# useradd test [root@fogstoragenode ~]# nano password [root@fogstoragenode ~]# passwd test <password Changing password for user test. New password: BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word Retype new password: passwd: all authentication tokens updated successfully. [root@fogstoragenode ~]# cat password | passwd test Changing password for user test. New password: BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word Retype new password: passwd: all authentication tokens updated successfully.
I tried it again after that in case it would have trouble overwriting the old password, but that gave the same output.
-
Screw this !!! I think this was happening because I haven’t properly disabled SElinux on that machine! Really strange that this would cause such a weird thing.
setenforce 0
and now both ways work for me as well. Thanks a lot for testing and your answers! -