wip
This commit is contained in:
parent
e8932df0cb
commit
86946636c4
2 changed files with 14 additions and 1 deletions
|
@ -4,4 +4,8 @@ files['/etc/ssh/sshd_config'] = {
|
|||
],
|
||||
}
|
||||
|
||||
svc_systemd['ssh'] = {}
|
||||
svc_systemd['ssh'] = {
|
||||
'needs': [
|
||||
'tag:ssh_users',
|
||||
],
|
||||
}
|
||||
|
|
|
@ -11,16 +11,25 @@ for name, config in node.metadata.get('users').items():
|
|||
'content': config['privkey'] + '\n',
|
||||
'owner': name,
|
||||
'mode': '0600',
|
||||
'tags': [
|
||||
'ssh_users',
|
||||
],
|
||||
}
|
||||
files[f"{config['home']}/.ssh/id_{config['keytype']}.pub"] = {
|
||||
'content': config['pubkey'] + '\n',
|
||||
'owner': name,
|
||||
'mode': '0600',
|
||||
'tags': [
|
||||
'ssh_users',
|
||||
],
|
||||
}
|
||||
files[config['home'] + '/.ssh/authorized_keys'] = {
|
||||
'content': '\n'.join(sorted(config['authorized_keys'])) + '\n',
|
||||
'owner': name,
|
||||
'mode': '0600',
|
||||
'tags': [
|
||||
'ssh_users',
|
||||
],
|
||||
}
|
||||
|
||||
users[name] = config
|
||||
|
|
Loading…
Reference in a new issue