mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
17 lines
542 B
Bash
Executable file
17 lines
542 B
Bash
Executable file
# this is a developer helper script to install the public ssh key on host running dropbear
|
|
|
|
function ssh_install_key {
|
|
if [ -e ~/.ssh/id_rsa.pub ]; then
|
|
echo "Adding public RSA key to $1"
|
|
KEY=`cat ~/.ssh/id_rsa.pub`
|
|
elif [ -e ~/.ssh/id_dsa.pub ]; then
|
|
echo "Adding public DSA key to $1"
|
|
KEY=`cat ~/.ssh/id_dsa.pub`
|
|
else
|
|
echo "No public key found"
|
|
exit 1
|
|
fi
|
|
ssh root@$1 "echo '$KEY' >> /etc/dropbear/authorized_keys" && echo ok
|
|
}
|
|
|
|
register_command "ssh_install_key" "Install the users public ssh key on host running dropbear"
|