From 4666f1c9236b0a7669073862447bccbe5a2278f4 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sat, 24 Jul 2021 12:10:03 +0200 Subject: [PATCH] bundles/users: remove duplicate keys from ssh pubkeys --- bundles/users/items.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/users/items.py b/bundles/users/items.py index d293c19..457c46a 100644 --- a/bundles/users/items.py +++ b/bundles/users/items.py @@ -45,7 +45,7 @@ for username, attrs in node.metadata['users'].items(): if 'ssh_pubkey' in attrs: files[home + '/.ssh/authorized_keys'] = { - 'content': '\n'.join(sorted(attrs['ssh_pubkey'])) + '\n', + 'content': '\n'.join(sorted(set(attrs['ssh_pubkey']))) + '\n', 'owner': username, 'mode': '0600', }