bundles/users: remove duplicate keys from ssh pubkeys

This commit is contained in:
Franzi 2021-07-24 12:10:03 +02:00
parent 36219dbb95
commit 4666f1c923
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -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',
}