#!/bin/sh # BEGIN compat # TODO: remove in one of the next releases, because it is obsolete # and only needed for auto-conversion convert_compat() { obs_auth_file=/tmp/flash/dropbear/authorized_keys if [ ! -e $obs_auth_file ]; then return fi echo "Obsolete authorized keys file detected, converting ..." chown root $dir chmod 700 $dir mv -f $obs_auth_file $dir modsave flash } # END compat case $1 in ""|load) for ak_file in authorized_keys known_hosts id_dsa id_rsa; do modreg file authorized-keys $ak_file "$ak_file" 0 $ak_file done modreg daemon --hide authorized-keys echo -n "Setting up SSH authorized_keys for root ... " dir="/tmp/flash/authorized_keys_root" mkdir -p $dir # BEGIN compat convert_compat # END compat [ ! -e ~root/.ssh ] && ln -s $dir ~root/.ssh echo "done." ;; unload) modunreg file authorized-keys modunreg daemon authorized-keys ;; start) ;; stop) ;; restart) ;; status) ;; *) echo "Usage: $0 [load|unload|start|stop|restart|status]" 1>&2 exit 1 ;; esac exit 0