Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
neil committed Dec 5, 2023
1 parent 012e856 commit 9e70b7d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,16 @@ if [ ! -e ~/.ssh/id_rsa ] ; then
ssh-keygen -f ~/.ssh/id_rsa -q -N ""
fi

cat enablessh.txt >enablessh.local

$vmsh uploadFile $osname ~/.ssh/id_rsa.pub /root/.ssh/authorized_keys

#add ssh key twice, to avoid bugs.
echo "echo '$(base64 -w 0 ~/.ssh/id_rsa.pub)' | openssl base64 -d >>~/.ssh/authorized_keys" >>enablessh.local
echo "" >>enablessh.local

echo "echo '$(cat ~/.ssh/id_rsa.pub)' >>~/.ssh/authorized_keys" >>enablessh.local
echo "" >>enablessh.local

cat enablessh.txt >enablessh.local

echo >>enablessh.local
echo "chmod 600 ~/.ssh/authorized_keys">>enablessh.local
Expand Down

0 comments on commit 9e70b7d

Please sign in to comment.