Outils pour utilisateurs

Outils du site


linux:qubes

Qubes OS

qvm-portfwd a télécharger ici https://gist.github.com/Joeviocoe


Dans dom0 :

nfs-sdd.sh
#!/bin/bash
 
# test si argument vide, on exit
if [ -z $1 ] ; then
	echo " Taper on ou off en argument du script"
	exit 0;
fi
 
if [ "$1" == "on" ] ;
	then
		qvm-block a nfs dom0:sdd && echo " open luks";
		qvm-run --pass-io nfs "sudo cryptsetup luksOpen /dev/xvdi1 DATA --key-file=/rw/config/crypto_keyfile.bin";
		qvm-run --pass-io nfs "sudo cryptsetup luksOpen /dev/xvdi3 MUSIQUE --key-file=/rw/config/crypto_keyfile.bin";
		sleep 6;
		echo " mount ";
		qvm-run --pass-io nfs "sudo mkdir -m 755 -p /mnt/DATA /mnt/MUSIQUE"
		qvm-run --pass-io nfs "sudo mount /dev/mapper/DATA /mnt/DATA";
		qvm-run --pass-io nfs "sudo mount /dev/mapper/MUSIQUE /mnt/MUSIQUE";
		sleep 1;
		qvm-run --pass-io nfs "sudo systemctl start nfs-server";
		sh qvm-portfwd nfs 111 tcp;
		sh qvm-portfwd nfs 2049 tcp;
		sh qvm-portfwd nfs 20048 tcp;
		sh qvm-portfwd nfs 41000 tcp;
		sh qvm-portfwd nfs 51000 tcp;
		sh qvm-portfwd nfs 111 udp;
                sh qvm-portfwd nfs 2049 udp;
                sh qvm-portfwd nfs 20048 udp;
                sh qvm-portfwd nfs 41100 udp;
                sh qvm-portfwd nfs 51000 udp;
		exit 0;
fi
 
if [ "$1" == "off" ] ;
	then
		qvm-run --pass-io nfs "sudo systemctl stop nfs-server" && sleep 2;
		qvm-run --pass-io nfs "sudo umount /mnt/DATA";
		qvm-run --pass-io nfs "sudo umount /mnt/MUSIQUE";
		qvm-run --pass-io nfs "sudo cryptsetup close DATA";
		qvm-run --pass-io nfs "sudo cryptsetup close MUSIQUE";
		sleep 3;
		qvm-block d nfs dom0:sdd;
		sh qvm-portfwd nfs clear all
		exit 0;
fi;
 
exit 0;
vpn-sdc.sh
#!/bin/bash
 
# test si argument vide, on exit
if [ -z $1 ] ; then
	echo " Taper on ou off en argument du script"
	exit 0;
fi
 
if [ "$1" == "on" ] ;
	then
		qvm-block a vpn dom0:sdc && echo " open luks";
		qvm-run --pass-io vpn "sudo cryptsetup luksOpen /dev/xvdi2 DATA --key-file=/rw/config/key.bin";
		sleep 6;
		echo " mount ";
		qvm-run --pass-io vpn "sudo mount /dev/mapper/DATA /mnt/DATA";
		qvm-run vpn "gnome-terminal";
		exit 0;
fi
 
if [ "$1" == "off" ] ;
	then
		qvm-run --pass-io vpn "sudo umount /mnt/DATA";
		qvm-run --pass-io vpn "sudo cryptsetup close DATA";
		sleep 5;
		qvm-block d vpn dom0:sdc
		exit 0;
fi;
 
exit 0;
linux/qubes.txt · Dernière modification: 2018/10/25 18:19 (modification externe)