u
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user