Update 'backup/generate-config.py'
parent
566ee37cc1
commit
9979fe0e5c
|
@ -14,6 +14,8 @@ s.close()
|
|||
assert socket.gethostbyname(hostname + ".162536.xyz") == ip_address, "Hostname does not resolve to ip!"
|
||||
|
||||
secret_seed = getpass.getpass("Enter passphrase: ").rstrip()
|
||||
assert getpass.getpass("Confirm passhphrase: ").rstrip() == secret_seed, "Passphrases do not match!"
|
||||
|
||||
salted_secret_seed = hostname + secret_seed
|
||||
salted_hash_value = hashlib.sha512(salted_secret_seed.encode())
|
||||
|
||||
|
@ -22,4 +24,6 @@ with open("/etc/backup.conf", "w") as f:
|
|||
f.write(f"export BORG_PASSPHRASE='{salted_hash_value.hexdigest()}'\n")
|
||||
|
||||
os.system("ssh-keygen -t rsa -q -f \"$HOME/.ssh/id_rsa\" -N \"\"")
|
||||
|
||||
input(f"Waiting for user creation: press enter when user created - suggested password: {os.system('openssl rand -hex 20')}")
|
||||
os.system(f"ssh-copy-id {hostname}@{server_hostname}.162536.xyz")
|
||||
|
|
Loading…
Reference in New Issue