Skip to content

Commit

Permalink
Add provisioner pub key
Browse files Browse the repository at this point in the history
  • Loading branch information
robsonsnt committed Dec 7, 2024
1 parent e43a58c commit 0cdf82a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
5 changes: 0 additions & 5 deletions rocky_linux_9/http/ks.cfg.pkrtpl
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,4 @@ Defaults:${ssh_username} !requiretty
Defaults:${ssh_username} visiblepw
${ssh_username} ALL=(ALL) NOPASSWD: ALL
EOF
mkdir -p /infra/.ssh
chmod 700 /infra/.ssh
touch /infra/.ssh/authorized_keys
chmod 600 /infra/.ssh/authorized_keys
chown -R infra:infra /infra/.ssh
%end
10 changes: 5 additions & 5 deletions rocky_linux_9/packer.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ build {
}
provisioner "shell" {
inline = [
# "sudo mkdir -p /infra/.ssh",
# "sudo chmod 700 /infra/.ssh",
"sudo echo $SSH_PUBLIC_KEY >> /infra/.ssh/authorized_keys"
# "sudo chmod 600 /infra/.ssh/authorized_keys",
# "sudo chown -R infra:infra /infra/.ssh"
"sudo mkdir -p /home/infra/.ssh",
"sudo chmod 700 /home/infra/.ssh",
"sudo echo $SSH_PUBLIC_KEY >> /home/infra/.ssh/authorized_keys",
"sudo chown -R infra:infra /home/infra/.ssh",
"sudo chmod 600 /home/infra/.ssh/authorized_keys"
]
}

Expand Down

0 comments on commit 0cdf82a

Please sign in to comment.