Skip to content

Commit

Permalink
Restrict key for user tf
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd-ntrf committed Jul 22, 2024
1 parent 538ab31 commit d0ea188
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/configuration/puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ users:
runcmd:
- test ! -d /${sudoer_username} && userdel -f -r ${sudoer_username} && cloud-init clean -r
- restorecon -R /${sudoer_username}
- echo -e "match User tf\n AuthorizedKeysFile /etc/ssh/authorized_keys.%u\n AuthenticationMethods publickey" >> /etc/ssh/sshd_config
- echo -e "match User tf\n\tAuthorizedKeysFile /etc/ssh/authorized_keys.%u\n\tAuthenticationMethods publickey" >> /etc/ssh/sshd_config
- sed -i '/HostKey \/etc\/ssh\/ssh_host_ecdsa_key/ s/^#*/#/' /etc/ssh/sshd_config
- chmod 644 /etc/ssh/ssh_host_*_key.pub
- chgrp ssh_keys /etc/ssh/ssh_host_*_key.pub
Expand Down Expand Up @@ -130,7 +130,7 @@ runcmd:
- test -f /etc/magic-castle-release && systemctl start puppet || true

write_files:
- content: ${tf_ssh_public_key}
- content: restrict ${tf_ssh_public_key}
path: /etc/ssh/authorized_keys.tf
permissions: "0644"
- content: |
Expand Down

0 comments on commit d0ea188

Please sign in to comment.