Move to ed25519 for FOTON sshkey

This commit is contained in:
Jeremy Gardais 2023-03-13 10:58:13 +01:00
parent e6174ec1fa
commit 36f9d85979
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 17 additions and 2 deletions

View File

@ -243,11 +243,24 @@ Try {
ssh-keygen -t ed25519 -f "D:\Home\$CurrentUser\Duplicati\.ssh\duplicati_id_ed25519" -q -N '""' ssh-keygen -t ed25519 -f "D:\Home\$CurrentUser\Duplicati\.ssh\duplicati_id_ed25519" -q -N '""'
Write-Log -Message "Création des clefs SSH ed25519 IPR" -Component $CurrentScript -LogFile $LogFile Write-Log -Message "Création des clefs SSH ed25519 IPR" -Component $CurrentScript -LogFile $LogFile
Send-MailMessage -SmtpServer smtpint.univ-rennes1.fr -From "$CurrentUser@univ-rennes1.fr" -To IPR.ADMIN.EMAIL@listes.univ-rennes1.fr -Subject "$Hostname $CurrentUser - Nouvelle clef Duplicati" -Attachments D:\Home\$CurrentUser\Duplicati\.ssh\duplicati_id_ed25519.pub Send-MailMessage -SmtpServer smtpint.univ-rennes1.fr -From "$CurrentUser@univ-rennes1.fr" -To IPR.ADMIN.EMAIL@listes.univ-rennes.fr -Subject "$Hostname $CurrentUser - Nouvelle clef Duplicati" -Attachments D:\Home\$CurrentUser\Duplicati\.ssh\duplicati_id_ed25519.pub
} }
$fichier = $fichier -replace "TARGETURLUR", "ssh://duplicati.ipr.univ-rennes1.fr//home//$CurrentUser//$NOMMACHINE//?auth-username=$CurrentUser&ssh-fingerprint=ssh-ed25519 32 4A:2D:A0:5F:66:7A:D5:3A:F4:B2:63:EC:EE:1E:D0:21&ssh-keyfile=D:\\Home\\$CurrentUser\\Duplicati\\.ssh\\duplicati_id_ed25519" $fichier = $fichier -replace "TARGETURLUR", "ssh://duplicati.ipr.univ-rennes1.fr//home//$CurrentUser//$NOMMACHINE//?auth-username=$CurrentUser&ssh-fingerprint=ssh-ed25519 32 4A:2D:A0:5F:66:7A:D5:3A:F4:B2:63:EC:EE:1E:D0:21&ssh-keyfile=D:\\Home\\$CurrentUser\\Duplicati\\.ssh\\duplicati_id_ed25519"
} }
FOTON FOTON
{
if (!(test-path "D:\Home\$CurrentUser\Duplicati\.ssh\duplicati_id_ed25519"))
{
ssh-keygen -t ed25519 -f "D:\Home\$CurrentUser\Duplicati\.ssh\duplicati_id_ed25519" -q -N '""'
Write-Log -Message "Création des clefs SSH ed25519 FOTON" -Component $CurrentScript -LogFile $LogFile
Send-MailMessage -SmtpServer smtpint.univ-rennes1.fr -From "$CurrentUser@univ-rennes1.fr" -To FOTON.ADMIN.EMAIL@univ-rennes.fr -Subject "$Hostname $CurrentUser - Nouvelle clef Duplicati" -Attachments D:\Home\$CurrentUser\Duplicati\.ssh\duplicati_id_ed25519.pub
}
$fichier = $fichier -replace "TARGETURLUR", "ssh://bkpdop.univ-rennes1.fr//mnt//datastore_backuppc//duplicati//$CurrentUser.$NOMMACHINE//?auth-username=$CurrentUser&ssh-fingerprint=ssh-ed25519 32 1E:EC:EB:7D:52:A3:54:5A:48:EA:59:6A:CF:8C:74:48&ssh-keyfile=D:\\Home\\$CurrentUser\\Duplicati\\.ssh\\duplicati_id_ed25519"
}
<# FOTON
{ {
if (!(test-path "D:\Home\$CurrentUser\Duplicati\.ssh\id_rsa_duplicati")) if (!(test-path "D:\Home\$CurrentUser\Duplicati\.ssh\id_rsa_duplicati"))
{ {
@ -256,9 +269,11 @@ Try {
Send-MailMessage -SmtpServer smtpint.univ-rennes1.fr -From "$CurrentUser@univ-rennes1.fr" -To FOTON.ADMIN.EMAIL@univ-rennes.fr -Subject "$Hostname $CurrentUser - Nouvelle clef Duplicati" -Attachments D:\Home\$CurrentUser\Duplicati\.ssh\duplicati_id_ed25519.pub Send-MailMessage -SmtpServer smtpint.univ-rennes1.fr -From "$CurrentUser@univ-rennes1.fr" -To FOTON.ADMIN.EMAIL@univ-rennes.fr -Subject "$Hostname $CurrentUser - Nouvelle clef Duplicati" -Attachments D:\Home\$CurrentUser\Duplicati\.ssh\duplicati_id_ed25519.pub
} }
$fichier = $fichier -replace "TARGETURLUR", "ssh://bkpdop.univ-rennes1.fr//mnt//datastore_backuppc//duplicati//$CurrentUser.$NOMMACHINE//?auth-username=$CurrentUser&ssh-fingerprint=ssh-rsa 2048 02:b9:38:a6:17:66:ba:90:e0:be:bb:7e:fb:a7:e6:14&ssh-keyfile=D:\\Home\\$CurrentUser\\Duplicati\\.ssh\\id_rsa_duplicati" $fichier = $fichier -replace "TARGETURLUR", "ssh://bkpdop.univ-rennes1.fr//mnt//datastore_backuppc//duplicati//$CurrentUser.$NOMMACHINE//?auth-username=$CurrentUser&ssh-fingerprint=ssh-ed25519 32 1E:EC:EB:7D:52:A3:54:5A:48:EA:59:6A:CF:8C:74:48&ssh-keyfile=D:\\Home\\$CurrentUser\\Duplicati\\.ssh\\id_rsa_duplicati"
#$fichier = $fichier -replace "TARGETURLUR", "ssh://bkpdop.univ-rennes1.fr//mnt//datastore_backuppc//duplicati//$CurrentUser.$NOMMACHINE//?auth-username=$CurrentUser&ssh-fingerprint=ssh-rsa 2048 02:b9:38:a6:17:66:ba:90:e0:be:bb:7e:fb:a7:e6:14&ssh-keyfile=D:\\Home\\$CurrentUser\\Duplicati\\.ssh\\id_rsa_duplicati"
} }
#>
} }
#Donne les droits à l'utilisateur courant aux clés ssh générées. #Donne les droits à l'utilisateur courant aux clés ssh générées.