Author: thomas
Date: Mon Jan 11 14:20:11 2021
New Revision: 24103

Log:
Fix sed for password hash

Modified:
   trunk/BOOK/general/prog/gitserver.xml

Modified: trunk/BOOK/general/prog/gitserver.xml
==============================================================================
--- trunk/BOOK/general/prog/gitserver.xml       Mon Jan 11 13:49:34 2021        
(r24102)
+++ trunk/BOOK/general/prog/gitserver.xml       Mon Jan 11 14:20:11 2021        
(r24103)
@@ -57,16 +57,20 @@
       <para>
         You will need to be user <systemitem class='username'>root</systemitem>
         for the initial portion of configuration. Create the <systemitem
-        class="username">git</systemitem> user and group with the following
-        commands:
+        class="username">git</systemitem> user and group and set and unusable
+        password hash with the following commands:
       </para>
 
 <screen role="root"><userinput>groupadd -g &gitgid; git &amp;&amp;
 useradd -c "git Owner" -d /home/git -m -g git -s /usr/bin/git-shell -u 
&gituid; git &amp;&amp;
-sed -i '/^git:/s/^git:.*:/git:NP:/' /etc/shadow</userinput></screen>
+sed -i '/^git:/s/^git:[^:]:/git:NP:/' /etc/shadow</userinput></screen>
 
       <para>
-        Create some files and directories in the home directory of the git user
+        Putting in an unuable password hash (replacing the <literal>!</literal>
+        by <literal>NP</literal>) unlocks the account but it cannot be used
+        to login via password authentication. That is required by 
+        <application>sshd</application> to work properly.
+        Next, create some files and directories in the home directory of the 
git user
         allowing access to the git repository using ssh keys.
       </para>
       
-- 
http://lists.linuxfromscratch.org/listinfo/blfs-book
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to