Skip to content

Commit

Permalink
Enable passwordless sudo via SSH
Browse files Browse the repository at this point in the history
  • Loading branch information
edigaryev committed Sep 28, 2022
1 parent 57792c0 commit e9d0196
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions templates/vanilla-monterey.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,11 @@ source "tart-cli" "tart" {

build {
sources = ["source.tart-cli.tart"]

provisioner "shell" {
inline = [
// Enable passwordless sudo
"echo admin | sudo -S sh -c \"echo 'admin ALL=(ALL) NOPASSWD: ALL' | EDITOR=tee visudo /etc/sudoers.d/admin-nopasswd\"",
]
}
}
7 changes: 7 additions & 0 deletions templates/vanilla-ventura.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,11 @@ source "tart-cli" "tart" {

build {
sources = ["source.tart-cli.tart"]

provisioner "shell" {
inline = [
// Enable passwordless sudo
"echo admin | sudo -S sh -c \"echo 'admin ALL=(ALL) NOPASSWD: ALL' | EDITOR=tee visudo /etc/sudoers.d/admin-nopasswd\"",
]
}
}

0 comments on commit e9d0196

Please sign in to comment.