Bug 750907

Summary: Using sshd option with Anaconda installer enables ssh access, but root account is locked
Product: [Fedora] Fedora Reporter: Mark Hamzy <hamzy>
Component: loraxAssignee: Will Woods <wwoods>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 16CC: anaconda-maint-list, bcl, karsten, mgracik
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: lorax-17.1-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-04 01:40:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mark Hamzy 2011-11-02 18:52:45 UTC
Description of problem:
When the Anaconda installed is booted and the 'sshd' boot option is passed, you still cannot sshd into the system with an empty password.

[root@chukar ~]# ssh root.90.169
root.90.169's password:
Permission denied, please try again.

When I switch to a bash console, I notice that there are two root entries in the shadow file.

[anaconda root@(none) /]# grep root /etc/shadow
root:*:15209:0:99999:7:::
root::14438:0:99999:7:::

The first entry causes the account to be locked.

Lorax has the following command in the share/runtime-postinstall.tmpl file:

append etc/shadow "root::14438:0:99999:7:::"

Comment 2 Mark Hamzy 2011-11-04 20:31:26 UTC
The root password is still not empty.  There is only one root entry now and it looks like this:

[anaconda root@(none) /]# grep root /etc/shadow
root::*:15209:0:99999:7:::

The fix looked like it added a colon and kept the *.  It should be:

[anaconda root@(none) /]# sed -i -e 's,::[*]:,::,' /etc/shadow
[anaconda root@(none) /]# grep root /etc/shadow
root::15209:0:99999:7:::

Comment 3 Will Woods 2011-11-09 17:45:56 UTC
hah, yep, I forgot that 'replace' uses regexes, so:
  replace "root:*:" "root::" etc/shadow
would end up replacing "root:" with "root::". Should be:
  replace "root:\*:" "root::" etc/shadow

Fixed in git:
http://git.fedorahosted.org/git/?p=lorax.git;a=commitdiff;h=e3bb8700