initial
This commit is contained in:
17
tools/make_ssh_keys
Normal file
17
tools/make_ssh_keys
Normal file
@@ -0,0 +1,17 @@
|
||||
mkdir .\data
|
||||
mkdir .\data\local_keys
|
||||
mkdir .\data\remote_keys
|
||||
del ./data/remote_keys/administrator_authorized_keys
|
||||
del ./data/local_keys/*
|
||||
del ./data/remote_keys/*
|
||||
for ($i=0; $i -lt 10; $i++){
|
||||
ssh-keygen -f ./data/local_keys/id_ecdsa_$i -t ecdsa -b 256 -q -N "''" -C "local_key"
|
||||
(Get-Content -Raw -Encoding Default "./data/remote_keys/id_ecdsa_$i") -replace "`r`n", "`n" | Set-Content -NoNewline -Encoding UTF8 "./data/remote_keys/id_ecdsa_$i"
|
||||
(Get-Content -Raw -Encoding Default "./data/remote_keys/id_ecdsa_$i.pub") -replace "`r`n", "`n" | Set-Content -NoNewline -Encoding UTF8 "./data/remote_keys/id_ecdsa_$i.pub"
|
||||
ssh-keygen -f ./data/remote_keys/id_ecdsa_$i -t ecdsa -b 256 -q -N "''" -C "remote_key"
|
||||
(Get-Content -Raw -Encoding Default "./data/local_keys/id_ecdsa_$i") -replace "`r`n", "`n" | Set-Content -NoNewline -Encoding UTF8 "./data/local_keys/id_ecdsa_$i"
|
||||
(Get-Content -Raw -Encoding Default "./data/local_keys/id_ecdsa_$i.pub") -replace "`r`n", "`n" | Set-Content -NoNewline -Encoding UTF8 "./data/local_keys/id_ecdsa_$i.pub"
|
||||
cat ./data/remote_keys/id_ecdsa_$i.pub >> ./data/remote_keys/administrator_authorized_keys
|
||||
(Get-Content -Raw -Encoding Default "./data/remote_keys/administrator_authorized_keys") -replace "`r`n", "`n" | Set-Content -NoNewline -Encoding UTF8 "./data/remote_keys/administrator_authorized_keys"
|
||||
del ./data/remote_keys/*.pub
|
||||
}
|
||||
Reference in New Issue
Block a user