cannot copy authorized_keys if hard linked so only copy if home dirs not preserved

This commit is contained in:
Gavin Li 2015-04-20 04:26:11 -07:00
parent d014a2433e
commit 0207a5f330
1 changed files with 2 additions and 2 deletions

View File

@ -393,8 +393,8 @@ postbootstrap_configuration() {
cp -al /{home,root} /archroot/
fi
# authorized_keys of root will be copied anyway
if [ -e /root/.ssh/authorized_keys ]; then
# just authorized_keys of root will be copied otherwise
if ! ${preserve_home_directories} && [ -e /root/.ssh/authorized_keys ]; then
mkdir -p /archroot/root/.ssh/
chmod 700 /archroot/root/.ssh/
cp -p /root/.ssh/authorized_keys /archroot/root/.ssh/authorized_keys