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
|
case $SSH_KEYS_PATH in
|
||||||
'') # leeg
|
'') # leeg
|
||||||
virt-customize --run-command '
|
virt-customize -a /tmp/"$IMAGE_NAME" \
|
||||||
CONFIG_FILE="/etc/cloud/cloud.cfg"
|
--run-command 'sed -i "s/^#PasswordAuthentication yes/PasswordAuthentication yes/" /etc/ssh/sshd_config' \
|
||||||
if ! grep -q "ssh_pwauth" "$CONFIG_FILE"; then
|
--run-command 'sed -i "s/^PasswordAuthentication no/PasswordAuthentication yes/" /etc/ssh/sshd_config' \
|
||||||
echo "ssh_pwauth: true" | sudo tee -a "$CONFIG_FILE" > /dev/null
|
--run-command 'systemctl restart sshd'
|
||||||
else
|
|
||||||
sudo sed -i "s/^ssh_pwauth false/ssh_pwauth true/" "$CONFIG_FILE"
|
|
||||||
fi' -a /tmp/"$IMAGE_NAME"
|
|
||||||
;;
|
;;
|
||||||
/tmp/temporary_ssh_key.pub) # iets
|
/tmp/temporary_ssh_key.pub) # iets
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue