Update create.sh
This commit is contained in:
parent
646031a735
commit
0e0b54c572
1 changed files with 4 additions and 7 deletions
11
create.sh
11
create.sh
|
|
@ -173,13 +173,10 @@ case $OSKEUZE in
|
|||
|
||||
case $SSH_KEYS_PATH in
|
||||
'') # leeg
|
||||
virt-customize --run-command '
|
||||
CONFIG_FILE="/etc/cloud/cloud.cfg"
|
||||
if ! grep -q "ssh_pwauth" "$CONFIG_FILE"; then
|
||||
echo "ssh_pwauth: true" | sudo tee -a "$CONFIG_FILE" > /dev/null
|
||||
else
|
||||
sudo sed -i "s/^ssh_pwauth false/ssh_pwauth true/" "$CONFIG_FILE"
|
||||
fi' -a /tmp/"$IMAGE_NAME"
|
||||
virt-customize -a /tmp/"$IMAGE_NAME" \
|
||||
--run-command 'sed -i "s/^#PasswordAuthentication yes/PasswordAuthentication yes/" /etc/ssh/sshd_config' \
|
||||
--run-command 'sed -i "s/^PasswordAuthentication no/PasswordAuthentication yes/" /etc/ssh/sshd_config' \
|
||||
--run-command 'systemctl restart sshd'
|
||||
;;
|
||||
/tmp/temporary_ssh_key.pub) # iets
|
||||
;;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue