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 \
3636 --parameters " commands=[
3737 'id',
3838 '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'
4343 ]" \
4444 --no-paginate --output text
4545
Original file line number Diff line number Diff line change 6363 echo " startxfce4" > ~ /.xsession
6464 chmod +x ~ /.xsession
6565
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
6771
6872elif [[ " $1 " == " set-jb-license-server" ]]; then
6973
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ ps wwwe -p 1 | tail -1
3434sed -i -e ' s~^PermitRootLogin~#PermitRootLogin~' /etc/ssh/sshd_config
3535echo PermitRootLogin yes >> /etc/ssh/sshd_config
3636
37+ sed -i -e ' s~^AuthorizedKeysFile~#AuthorizedKeysFile~' /etc/ssh/sshd_config
38+ echo " AuthorizedKeysFile /etc/ssh/authorized_keys" >> /etc/ssh/sshd_config
39+
3740# Start SSH server
3841if _is_centos; then
3942 # 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