From a60dda7eaee59c007f545a6a99da589243aa0e26 Mon Sep 17 00:00:00 2001 From: Daniel Dehennin Date: Mon, 14 Sep 2015 16:52:44 +0200 Subject: [PATCH] Create SSH directory before authorized_keys file --- base/etc/one-context.d/02-ssh_public_key | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/etc/one-context.d/02-ssh_public_key b/base/etc/one-context.d/02-ssh_public_key index da5f184..e84015c 100755 --- a/base/etc/one-context.d/02-ssh_public_key +++ b/base/etc/one-context.d/02-ssh_public_key @@ -29,10 +29,10 @@ function add_keys { [ -z "${SSH_PUBLIC_KEY}${EC2_PUBLIC_KEY}" ] && exit 0 -[ ! -f $AUTH_FILE ] && touch $AUTH_FILE - mkdir -m0700 -p $AUTH_DIR +[ ! -f $AUTH_FILE ] && touch $AUTH_FILE + if [ -n "$SSH_PUBLIC_KEY" ]; then echo "$SSH_PUBLIC_KEY" | add_keys fi