6 Commits
v37 ... v40

Author SHA1 Message Date
raphanaud
5691bc4e42 40-vlan 2021-10-11 11:54:35 +02:00
raphanaud
cdf2c8db14 script 2021-10-08 15:45:28 +02:00
Raphanaud
9c37b351ec passusr.py 2021-10-06 09:31:00 +02:00
Raphanaud
a28bbb33b1 log.py 2021-10-06 09:29:34 +02:00
Raphanaud
835ab8ab74 Merge branch 'master' of https://gitea.lyc-lecastel.fr/noe.raphanaud/siotp 2021-10-06 09:19:17 +02:00
80d8be6df5 Mise à jour de 'sio2/sisr/35-script/python/passusr.py' 2021-09-30 16:16:20 +02:00
6 changed files with 61 additions and 189763 deletions

View File

@@ -0,0 +1,17 @@
#!/bin/bash
DAT=$(date "+%u")
DEST=/home/sv/d/"${DAT}"
HOST=root@192.168.0.29
ssh "${HOST}" apt install -y rsync apache2 mariadb-server php
ssh "${HOST}" "mysql CREATE DATABASES wordpress;" #a refaire
ssh "${HOST}" "mysql -u wordpress_user -pqdrhh45 wordpress < "${DEST}"/wordpress.sql" #a refaire
scp -r "${DEST}"/wordpress "${HOST}":/var/www/html/
scp "${DEST}"/default-ssl.conf "${HOST}":/etc/apache2/sites-available/
scp "${DEST}"/wordpress.conf "${HOST}":/etc/apache2/sites-available/
scp "${DEST}"/server.key "${HOST}":/etc/apache2/
scp "${DEST}"/server.crt "${HOST}":/etc/apache2/
#rsync -az "${DEST}"/wordpress "${HOST}":/var/www/html/
#rsync -az "${DEST}"/default-ssl.conf "${HOST}":/etc/apache2/sites-available/
#rsync -az "${DEST}"/wordpress.conf "${HOST}":/etc/apache2/sites-available/
#rsync -az "${DEST}"/server.key "${HOST}":/etc/apache2/
#rsync -az "${DEST}"/server.crt "${HOST}":/etc/apache2/

View File

@@ -0,0 +1,15 @@
#!/bin/bash
DAT=$(date "+%u")
DEST=/home/sv
DEST2="${DEST}/d/${DAT}"
[ -d "${DEST}/d" ] || mkdir -p "${DEST}/d"
[ -d "${DEST}/d/${DAT}" ] || mkdir -p "${DEST}/d/${DAT}"
HOST=sauv@192.168.0.34
ssh "${HOST}" "mysqldump -u wordpress_user -pqdrhh45 wordpress|gzip -" >"${DEST2}"/wordpress.sql.gz
rsync -av -e ssh "${HOST}":/var/www/html/wordpress "${DEST2}"
rsync -av -e ssh "${HOST}":/etc/apache2/sites-available/default-ssl.conf "${DEST2}"/default-ssl.conf
rsync -av -e ssh "${HOST}":/etc/apache2/sites-available/wordpress.conf "${DEST2}"/wordpress.conf
rsync -av -e ssh "${HOST}":/etc/apache2/server.key "${DEST2}"/server.key
rsync -av -e ssh "${HOST}":/etc/apache2/server.crt "${DEST2}"/server.crt

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
#!/usr/lib/python3
#!/usr/bin/python3
import sys
import subprocess
import os
@@ -21,10 +21,7 @@ else:
res = os.system ("getent passwd "+login)
if res != 0:
passw = ["pwgen", "4","1"]
#passw = "pwgen 4 1"
os.system (cmd)
#mdp = str(os.system (passw))
#print (mdp)
mdp = subprocess.run(passw,capture_output=True)
mdp2 = mdp.stdout.decode("utf-8")
mdp3 = mdp2.rstrip()

View File

@@ -0,0 +1,23 @@
config setup
charondebug="all"
uniqueids=yes
strictcrlpolicy=no
conn %default
conn tunnel #
left=10.0.0.2
leftsubnet=192.168.2.0/24
right=10.0.0.1
rightsubnet=192.168.1.0/24
ike=aes256-sha2_256-modp1024!
esp=aes256-sha2_256!
keyingtries=0
ikelifetime=1h
lifetime=8h
dpddelay=30
dpdtimeout=120
dpdaction=restart
authby=secret
auto=start
keyexchange=ikev2
type=tunnel

View File

@@ -0,0 +1,5 @@
# This file holds shared secrets or RSA private keys for authentication.
# RSA private key for this host, authenticating it to any other host
# which knows the public part.
10.0.0.2 10.0.0.1 : PSK 'root'