Skip to content

Commit

Permalink
fish: prep_vm_archinstall: Copy public key to VM for one less prompt
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
  • Loading branch information
nathanchance committed Jan 6, 2025
1 parent a1c35d1 commit d66d78f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fish/functions/prep_vm_archinstall.fish
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
function prep_vm_archinstall -d "Prepare archinstall files for virtual machine installation"
read -P 'Password for virtual machine user: ' -s user_pass

ssh_vm root copy-id
or return

set creds /tmp/creds.json
echo '{
"!root-password": null,
Expand Down
7 changes: 7 additions & 0 deletions fish/functions/ssh_vm.fish
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ function ssh_vm -d "ssh into a VM running via cbl_vmm.py"
switch $arg
case nathan root
set user $arg
case copy-id
set ssh_cmd ssh-copy-id
case scp transfer
set ssh_cmd scp
case '*'
Expand Down Expand Up @@ -67,6 +69,11 @@ function ssh_vm -d "ssh into a VM running via cbl_vmm.py"
-p $port \
$user_host \
$cmd

case ssh-copy-id
set -a cmd_args \
-p $port \
$user_host
end

set full_cmd \
Expand Down

0 comments on commit d66d78f

Please sign in to comment.