Merge ssh keys rather than overwriting them.
This commit is contained in:
1 parent
4e737e739f
commit
a4451e82ac
1 file changed
+2
-2
@@ -6,8 +6,8 @@ TARGET_DIR="$3"
|
|||||||
|
|
||||||
[[ -f $IMPORT_DIR/.sshcommand ]] && mv $IMPORT_DIR/.sshcommand $TARGET_DIR/.sshcommand
|
[[ -f $IMPORT_DIR/.sshcommand ]] && mv $IMPORT_DIR/.sshcommand $TARGET_DIR/.sshcommand
|
||||||
if [[ -f $IMPORT_DIR/.ssh/authorized_keys ]]; then
|
if [[ -f $IMPORT_DIR/.ssh/authorized_keys ]]; then
|
||||||
mkdir $TARGET_DIR/.ssh
|
mkdir -p $TARGET_DIR/.ssh
|
||||||
mv $IMPORT_DIR/.ssh/authorized_keys $TARGET_DIR/.ssh/authorized_keys
|
cat $IMPORT_DIR/.ssh/authorized_keys $TARGET_DIR/.ssh/authorized_keys | uniq > $TARGET_DIR/.ssh/authorized_keys
|
||||||
chmod 0700 $TARGET_DIR/.ssh
|
chmod 0700 $TARGET_DIR/.ssh
|
||||||
chmod 0600 $TARGET_DIR/.ssh/*
|
chmod 0600 $TARGET_DIR/.ssh/*
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in new issue
Block a user