File tree Expand file tree Collapse file tree 3 files changed +20
-9
lines changed
enos/modules/docker_openssh_server_ca_key Expand file tree Collapse file tree 3 files changed +20
-9
lines changed Original file line number Diff line number Diff line change 2
2
# Copyright (c) HashiCorp, Inc.
3
3
# SPDX-License-Identifier: BUSL-1.1
4
4
5
- cp /ca/ca-key.pub /etc/ssh /ca-key.pub
6
- chown 1000:1000 /etc/ssh /ca-key.pub
7
- chmod 644 /etc/ssh /ca-key.pub
8
- echo TrustedUserCAKeys /etc/ssh /ca-key.pub >> /etc/ssh /sshd_config
9
- echo PermitTTY yes >> /etc/ssh /sshd_config
10
- sed -i 's/X11Forwarding no/X11Forwarding yes/' /etc/ssh /sshd_config
11
- echo "X11UseLocalhost no" >> /etc/ssh /sshd_config
5
+ cp /ca/ca-key.pub /config/sshd /ca-key.pub
6
+ chown 1000:1000 /config/sshd /ca-key.pub
7
+ chmod 644 /config/sshd /ca-key.pub
8
+ echo TrustedUserCAKeys /config/sshd /ca-key.pub >> /config/sshd /sshd_config
9
+ echo PermitTTY yes >> /config/sshd /sshd_config
10
+ sed -i 's/X11Forwarding no/X11Forwarding yes/' /config/sshd /sshd_config
11
+ echo "X11UseLocalhost no" >> /config/sshd /sshd_config
12
12
13
13
apk update
14
14
apk add xterm util-linux dbus ttf-freefont xauth firefox
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/with-contenv bash
2
+ # Copyright (c) HashiCorp, Inc.
3
+ # SPDX-License-Identifier: BUSL-1.1
4
+
5
+ sed -i 's/AllowTcpForwarding no/AllowTcpForwarding yes/' /config/sshd/sshd_config
Original file line number Diff line number Diff line change @@ -61,9 +61,14 @@ locals {
61
61
ca_public_key = data. tls_public_key . ca_key . public_key_openssh
62
62
}
63
63
64
+ data "docker_registry_image" "openssh" {
65
+ name = var. image_name
66
+ }
67
+
64
68
resource "docker_image" "openssh_server" {
65
- name = var. image_name
66
- keep_locally = true
69
+ name = var. image_name
70
+ keep_locally = true
71
+ pull_triggers = [data . docker_registry_image . openssh . sha256_digest ]
67
72
}
68
73
69
74
resource "docker_container" "openssh_server" {
@@ -75,6 +80,7 @@ resource "docker_container" "openssh_server" {
75
80
" TZ=US/Eastern" ,
76
81
" USER_NAME=${ var . target_user } " ,
77
82
" PUBLIC_KEY=${ local . ssh_public_key } " ,
83
+ " SUDO_ACCESS=true" ,
78
84
]
79
85
network_mode = " bridge"
80
86
dynamic "networks_advanced" {
You can’t perform that action at this time.
0 commit comments