Skip to content
Snippets Groups Projects
Commit 4bf13f55 authored by Mike Lockwood's avatar Mike Lockwood
Browse files

Add support for default authorized_keys file


Change-Id: I23c9f3a1aebaac090db21f55a0ba792a2412206b
Signed-off-by: default avatarMike Lockwood <lockwood@google.com>
parent dfc3178b
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,8 @@ DSA_KEY=/data/ssh/ssh_host_dsa_key
DSA_PUB_KEY=/data/ssh/ssh_host_dsa_key.pub
RSA_KEY=/data/ssh/ssh_host_rsa_key
RSA_PUB_KEY=/data/ssh/ssh_host_rsa_key.pub
AUTHORIZED_KEYS=/data/ssh/authorized_keys
DEFAULT_AUTHORIZED_KEYS=/system/etc/security/authorized_keys.default
if [ ! -f $DSA_KEY ]; then
ssh-keygen -t dsa -f $DSA_KEY -N ""
......@@ -19,6 +21,10 @@ if [ ! -f $RSA_KEY ]; then
chmod 644 $RSA_PUB_KEY
fi
if [[ ! -f $AUTHORIZED_KEYS && -f $DEFAULT_AUTHORIZED_KEYS ]]; then
cat $DEFAULT_AUTHORIZED_KEYS > $AUTHORIZED_KEYS
fi
if [ "1" == "$DEBUG" ] ; then
# run sshd in debug mode and capture output to logcat
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment