[Server-devel] create_user and re-registration

Daniel Drake dsd at laptop.org
Mon Oct 12 04:53:44 EDT 2009


2009/10/12 Martin Langhoff <martin.langhoff at gmail.com>:
> So that's the issue. I think you sent the wrong patch. No awk line in
> the patch, at least that I can see...

Odd, lets try again.
-------------- next part --------------
--- create_user.orig	2009-10-12 12:36:44.000000000 +0545
+++ create_user	2009-10-12 12:36:44.000000000 +0545
@@ -99,6 +99,11 @@
 
 mkdir -p --mode=700 .ssh || clean_up_and_die "Unable to mkdir .ssh"
 echo "ssh-dss $pubkey" >> .ssh/authorized_keys || clean_up_and_die "Unable to set up authorized_keys"
+
+# remove duplicate lines
+awk '!x[$0]++' .ssh/authorized_keys > .ssh/authorized_keys.tmp
+mv -f .ssh/authorized_keys{.tmp,}
+
 chmod 600 .ssh/authorized_keys  || clean_up_and_die "Unable to chmod authorized_keys"
 chown -R $username .ssh || clean_up_and_die "Unable to chown .ssh"
 


More information about the Server-devel mailing list