password root oculta

master
fanta 8 months ago
parent cf3c896fbb
commit e7afb901da

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

Loading…
Cancel
Save