mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-10 15:12:01 -03:30
ncp.sh,SSH.sh: Move root login configuration to SSH.sh
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
parent
ab4545399e
commit
96b2c19823
@ -11,6 +11,13 @@
|
||||
install() {
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends openssh-server
|
||||
if grep '^PermitRootLogin' /etc/ssh/sshd_config
|
||||
then
|
||||
sed -i -e 's/^PermitRootLogin.*$/PermitRootLogin prohibit-password/' /etc/ssh/sshd_config
|
||||
else
|
||||
echo 'PermitRootLogin prohibit-password' >> /etc/ssh/sshd_config
|
||||
fi
|
||||
systemctl reload ssh
|
||||
}
|
||||
|
||||
is_active()
|
||||
|
||||
1
ncp.sh
1
ncp.sh
@ -83,7 +83,6 @@ EOF
|
||||
is_docker || is_lxc || {
|
||||
chsh -s /usr/sbin/nologin "$WEBADMIN"
|
||||
passwd -l root
|
||||
sed -i -e 's/^PermitRootLogin.*$/PermitRootLogin No/' /etc/ssh/sshd_config
|
||||
}
|
||||
|
||||
## NCP LAUNCHER
|
||||
|
||||
@ -7,7 +7,13 @@ if getent passwd "root" | grep -e '/usr/sbin/nologin'
|
||||
then
|
||||
chsh -s /bin/bash root
|
||||
passwd -l root
|
||||
sed -i -e 's/^PermitRootLogin.*$/PermitRootLogin No/' /etc/ssh/sshd_config
|
||||
if grep '^PermitRootLogin' /etc/ssh/sshd_config
|
||||
then
|
||||
sed -i -e 's/^PermitRootLogin.*$/PermitRootLogin prohibit-password/' /etc/ssh/sshd_config
|
||||
else
|
||||
echo 'PermitRootLogin prohibit-password' >> /etc/ssh/sshd_config
|
||||
fi
|
||||
systemctl reload ssh
|
||||
fi
|
||||
echo "done."
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user