This is an old revision of the document!
doveadm pw -s SHA512 -p mojeheslo
$ID$SALT$HASH $ID = typ hash fce; $1 = MD5, $2 = Blowfish, $5 = SHA-256, $6 = SHA-512 $SALT = salt, plaintext $HASH = vysledny hash
openssl passwd -1 -salt nejakejSalt - zadani hesla - vystup: $1$nejakejSalt$hash
certbot certonly \ --webroot \ -w /var/www/example.com/web \ -d example.com \ -d www.example.com \ -m hostmaster@example.com \ [--dry-run]
/etc/systemd/logind.conf:HandleLidSwitch=ignore
systemctl restart systemd-logindapt install --no-install-recommends \ bridge-utils \ libosinfo-bin \ libvirt-bin \ qemu-kvm \ qemu-utils \ virtinst
systemctl enable libvirtd
systemctl start libvirtd
Vytvořit image
qemu-img create -f qcow2 -o preallocation=metadata /var/vms/my-little-vm/my-little-vm-disk.qcow2 350G
Vytvořit bridge br0
network: version: 2 renderer: networkd ethernets: eno1: dhcp4: no dhcp6: no bridges: br0: interfaces: [eno1] dhcp4: no dhcp6: yes addresses: [192.168.104.3/24] gateway4: 192.168.104.1 nameservers: addresses: [1.1.1.1,9.9.9.9]
Seznam typů OS
osinfo-query os
Vytvořit virtuálku
virt-install \ --name=win10 \ --hvm \ --vcpus=4 \ --memory=8192\ --disk path=/var/vms/my-little-vm/my-little-vm-disk.qcow2,format=qcow2,bus=virtio \ --disk device=cdrom,path=/path/to/Windows10_1909_CZ_x86+x64.iso \ --disk device=cdrom,path=/path/to/virtio-win-0.1.171.iso \ --network=bridge:virbr0,model=virtio \ --os-type=windows --os-variant=win10 \ --virt-type kvm \ --graphics vnc
virsh edit jmenovirtualky
<os> <boot dev='hd'/> <boot dev='cdrom'/> <bootmenu enable='yes'> </os>
<disk ...> <target dev='vda' bus='virtio'> </disk>
(+ smazat <address … />)
<interface type='bridge'> <model type='virtio'/> </interface>
<cdrom>, změnit pozici (na IDE řadič se vejdou dvě zařízení).E:\viostor\<os>\amd64Zdroj: https://wiki.archlinux.org/index.php/QEMU#Preparing_a_Windows_guest
lsusb
ID AAAA:BBBB ⇒ AAAA = Vendor ID, BBBB = Product ID
<devices> <hostdev mode='subsystem' type='usb' managed='yes'> <source> <vendor id='0xAAAA'/> <product id='0xBBBB'/> </source> </hostdev> </devices>
5900 (včetně). Přístup třeba přes SSH tunel.<graphics type='vnc' port='-1' autoport='yes'>
virsh list --all
virsh start jmenovirtualky virsh reboot jmenovirtualky # ustřelení virsh destroy jmenovirtualky virsh suspend/resume jmenovirtualky
virsh autostart jmenovirtualky
virsh list --all --autostart
virsh undefine jmenovirtualky
Pozor: nesmaže data, jen odregistruje.
virsh domrename puvodnijmeno novejmeno
virsh attach-disk jmenovirtualky \ --source /cesta/k/image/souboru \ --target vdX \ [--persistent]
X = volné písmeno
virsh -c qemu:///system list
Doplnit do /etc/environment, nebo .bashrc, nebo /etc/profile):
LIBVIRT_DEFAULT_URI='qemu:///system'
qemu-img convert -O qcow2 puvodni-image.ova novy-image.qcow2
apt install libsasl2-modules postfix.debian.int.nazevfirmy.cz).etc/postfix/sasl_passwd a do něj napsat:[mail.isp.example]:587 username:password.postmap /etc/postfix/sasl_passwd - vytvoří se /etc/postfix/sasl_passwd.db.sasl_passwd.db:chown root:root /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.dbchmod 0600 /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db/etc/postfix/main.cf:relayhost = [mail.isp.example]:587mynetworks= přidat IP adresu/rozsah, ze kterých bude postfix přijímat poštu jako submission (IP adresu přidat s prefixem /32, tj. třeba 10.0.0.5/32).# enable SASL authentication smtp_sasl_auth_enable = yes # disallow methods that allow anonymous authentication. smtp_sasl_security_options = noanonymous # where to find sasl_passwd smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd # Enable STARTTLS encryption smtp_use_tls = yes # where to find CA certificates smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
Důležité:
From:” nastaveno na odesílatele z dané domény.Otestování konfigurace
echo “body of your email” | mail -s “This is a Subject” -a “From: sender@example.com” recipient@elsewhere.com
Variantně přes balík s-nail, který umí specifikovat jiný SMTP server než výchozí pro systém:
cat ~/.mailrc set mta=smtp://ip-adresa-smtp-serveru
echo “body of your email” | s-nail -r “sender@example.com” -s “This is a Subject” recipient@elsewhere.comZdroj: https://www.linode.com/docs/email/postfix/postfix-smtp-debian7/