A bunch of scriptlets I created or found
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CLITools/applysshkey.ps1

8 lines
263 B

4 years ago
$destinationHost = $args[0]
if ($destinationHost -eq $null)
{
$destinationHost = Read-Host -Prompt "Enter Host (e.g. root@contoso.com)"
}
type $env:USERPROFILE\.ssh\id_rsa.pub | ssh $destinationHost '[ -d .ssh ] || mkdir .ssh; cat >> .ssh/authorized_keys'