password root oculta

master
fanta 7 months ago
parent cf3c896fbb
commit e7afb901da

@ -5,6 +5,7 @@
import os
import requests
import shutil
from getpass import getpass
dirVms=os.path.expanduser('~')+"/vms"
dirVmsTemp=dirVms+"/templates"
@ -57,7 +58,9 @@ def createVms():
vmSize=input("\nSize: ")
os.system("qemu-img resize "+dirVmsImgs+"/"+vmName+".qcow2 "+vmSize+"G")
print("\nPassword de root")
vmPasswd=input("\nPassword: ")
#vmPasswd=input("\nPassword: ")
vmPasswd=getpass("\nPassword: ")
os.system("virt-customize -a "+dirVmsImgs+"/"+vmName+".qcow2 --root-password password:"+vmPasswd)
os.system("virt-customize -a "+dirVmsImgs+"/"+vmName+".qcow2 --hostname "+vmName)
os.system("virt-customize -a "+dirVmsImgs+"/"+vmName+".qcow2 --install dropbear")

Loading…
Cancel
Save