blob: 8e5b187a11e14c33d6d8179cf792c5c7dbecd3c7 [file] [log] [blame]
Mohammed Naserf3f59a72023-01-15 21:02:04 -05001#!/bin/bash
2
3{{/*
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/}}
16
17set -ex
18
19export NOVA_USERNAME=$(id -u ${NOVA_USER_UID} -n)
20export NOVA_USER_HOME=$(eval echo ~${NOVA_USERNAME})
21
22mkdir -p ${NOVA_USER_HOME}/.ssh
Mohammed Naserf3f59a72023-01-15 21:02:04 -050023
24cat > ${NOVA_USER_HOME}/.ssh/config <<EOF
25Host *
26 StrictHostKeyChecking no
27 UserKnownHostsFile /dev/null
28 port $SSH_PORT
29 IdentitiesOnly yes
30EOF
31
32cp /tmp/nova-ssh/* ${NOVA_USER_HOME}/.ssh/
33chmod 600 ${NOVA_USER_HOME}/.ssh/id_rsa
okozachenko1203ea639e72023-08-30 23:25:38 +100034chown -R ${NOVA_USERNAME}:${NOVA_USERNAME} ${NOVA_USER_HOME}/.ssh