Skip to content

Commit

Permalink
Update root.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanY610 authored Jul 29, 2023
1 parent f63a443 commit c8a8187
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vpsroot/root.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ lsattr /etc/passwd /etc/shadow >/dev/null 2>&1
prl=`grep PermitRootLogin /etc/ssh/sshd_config`
pa=`grep PasswordAuthentication /etc/ssh/sshd_config`
if [[ -n $prl && -n $pa ]]; then
read -p "请输入端口号(默认为 22):" sshport
read -p "请设置ssh端口号(默认为 22):" sshport
sshport=${sshport:-22} # 如果用户没有输入,则使用默认值22

read -p "请输入密码" password
read -p "请设置root密码" password
# 如果用户没有输入密码,则设置一个随机密码
if [ -z "$password" ]; then
password=$(openssl rand -base64 12)
Expand Down

0 comments on commit c8a8187

Please sign in to comment.