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.
29 lines
632 B
29 lines
632 B
# Buka SSH shell ke VM Ollama (aiopr) |
|
# Usage: .\scripts\ssh-ollama.ps1 |
|
# .\scripts\ssh-ollama.ps1 -Command "hostname" |
|
# .\scripts\ssh-ollama.ps1 -User geonet |
|
|
|
param( |
|
[string]$Command = "", |
|
[ValidateSet("root", "geonet")] |
|
[string]$User = "root" |
|
) |
|
|
|
$HostAddr = "10.100.1.26" |
|
$SshPort = 22 |
|
$SshMac = "hmac-sha1" |
|
$IdentityFile = Join-Path $env:USERPROFILE ".ssh\id_rsa_geonet_laptop" |
|
$SshArgs = @( |
|
"-i", $IdentityFile, |
|
"-o", "IdentitiesOnly=yes", |
|
"-m", $SshMac, |
|
"${User}@${HostAddr}", |
|
"-p", $SshPort |
|
) |
|
|
|
if ($Command) { |
|
$SshArgs += $Command |
|
ssh @SshArgs |
|
} else { |
|
ssh @SshArgs |
|
}
|
|
|