This commit is contained in:
Luk Lu
2023-01-14 12:33:11 +08:00
parent b234cc5bbe
commit 393552e69d
8 changed files with 68 additions and 3 deletions

View File

@@ -29,6 +29,7 @@ elif [ -d $NIXHOME5 ]
then
NIXHOME=$NIXHOME5
else
echo ××× none of the testing path is valid.
echo "=== Enter [nixhome path] or leave [blank] to exit"
read -p ">>> " NIXHOME
echo ""
@@ -101,7 +102,7 @@ then
# 由 root 指定新用户而创建的配置文件的 owner 是 root而不是新用户导致新用户无法读取该文件而密钥登录失败因此要重设 owner。
chown $TheUser:$TheUser $HomePath/.ssh
fi
if [ -e '$HomePath/.ssh/authorized_keys' ]
if [ -e "$HomePath/.ssh/authorized_keys" ]
then
mv $HomePath/.ssh/authorized_keys $HomePath/.ssh/authorized_keys.backup-$(date +%Y%m%dT%H%M%S)
fi