File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -36,10 +36,10 @@ aws --no-cli-pager ssm send-command \
36
36
--parameters " commands=[
37
37
'id',
38
38
'aws sts get-caller-identity',
39
- 'mkdir -p /root/. ssh/authorized_keys.d/',
40
- 'aws s3 cp --recursive ${SSH_AUTHORIZED_KEYS} /root/. ssh/authorized_keys.d/',
41
- 'cat /root/. ssh/authorized_keys.d/* > /root/. ssh/authorized_keys',
42
- 'cat /root/. ssh/authorized_keys'
39
+ 'mkdir -p /etc/ ssh/authorized_keys.d/',
40
+ 'aws s3 cp --recursive ${SSH_AUTHORIZED_KEYS} /etc/ ssh/authorized_keys.d/',
41
+ 'cat /etc/ ssh/authorized_keys.d/* > /etc/ ssh/authorized_keys',
42
+ 'cat /etc/ ssh/authorized_keys'
43
43
]" \
44
44
--no-paginate --output text
45
45
Original file line number Diff line number Diff line change 63
63
echo " startxfce4" > ~ /.xsession
64
64
chmod +x ~ /.xsession
65
65
66
- sed -i~~ -e ' s/^\#ClientAliveInterval 0$/ClientAliveInterval 15/' /etc/ssh/sshd_config
66
+ sed -i -e ' s~^ClientAliveInterval~#ClientAliveInterval~' /etc/ssh/sshd_config
67
+ echo " ClientAliveInterval 15" >> /etc/ssh/sshd_config
68
+
69
+ sed -i -e ' s~^AuthorizedKeysFile~#AuthorizedKeysFile~' /etc/ssh/sshd_config
70
+ echo " AuthorizedKeysFile /etc/ssh/authorized_keys" >> /etc/ssh/sshd_config
67
71
68
72
elif [[ " $1 " == " set-jb-license-server" ]]; then
69
73
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ ps wwwe -p 1 | tail -1
34
34
sed -i -e ' s~^PermitRootLogin~#PermitRootLogin~' /etc/ssh/sshd_config
35
35
echo PermitRootLogin yes >> /etc/ssh/sshd_config
36
36
37
+ sed -i -e ' s~^AuthorizedKeysFile~#AuthorizedKeysFile~' /etc/ssh/sshd_config
38
+ echo " AuthorizedKeysFile /etc/ssh/authorized_keys" >> /etc/ssh/sshd_config
39
+
37
40
# Start SSH server
38
41
if _is_centos; then
39
42
# NOTE: systemctl will not work in CentOS SageMaker container (e.g. Spark processing) because lack of
You can’t perform that action at this time.
0 commit comments