Skip to content

Commit 9c9463a

Browse files
committed
update lib
1 parent 7cb53aa commit 9c9463a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

libraries/util.bash

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2300,7 +2300,7 @@ function addUser()
23002300

23012301
if [[ "$(isEmptyString "${userHome}")" = 'true' || ! -d "${userHome}" ]]
23022302
then
2303-
mkdir -p "/home/${userLogin}"
2303+
mkdir -m 700 -p "/home/${userLogin}"
23042304
chown -R "${userLogin}:${groupName}" "/home/${userLogin}"
23052305
fi
23062306
fi
@@ -2420,9 +2420,7 @@ function configUserSSH()
24202420

24212421
checkExistFolder "${userHome}"
24222422

2423-
mkdir -p "${userHome}/.ssh"
2424-
chmod 700 "${userHome}/.ssh"
2425-
2423+
mkdir -m 700 -p "${userHome}/.ssh"
24262424
touch "${userHome}/.ssh/${configFileName}"
24272425
appendToFileIfNotFound "${userHome}/.ssh/${configFileName}" "${sshRSA}" "${sshRSA}" 'false' 'false' 'false'
24282426
chmod 600 "${userHome}/.ssh/${configFileName}"
@@ -2525,8 +2523,7 @@ function generateUserSSHKey()
25252523
header "GENERATING SSH KEY FOR USER '${userLogin}'"
25262524

25272525
rm -f "${userHome}/.ssh/id_rsa" "${userHome}/.ssh/id_rsa.pub"
2528-
mkdir -p "${userHome}/.ssh"
2529-
chmod 700 "${userHome}/.ssh"
2526+
mkdir -m 700 -p "${userHome}/.ssh"
25302527
chown "${userLogin}:${groupName}" "${userHome}/.ssh"
25312528

25322529
su -l "${userLogin}" -c "ssh-keygen -q -t rsa -N '' -f '${userHome}/.ssh/id_rsa'"

0 commit comments

Comments
 (0)