aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Grad <florin@mandriva.com>2001-09-19 12:18:16 +0000
committerFlorin Grad <florin@mandriva.com>2001-09-19 12:18:16 +0000
commit5dafd636b6afef22a21571bd0af6d334ddb88ed8 (patch)
tree157b8ad4c49dee602d333b7ebba7a955a2eb389e
parente97350555ed7a2339e247a9e44edabd4705a3d1f (diff)
downloadmsec-5dafd636b6afef22a21571bd0af6d334ddb88ed8.tar
msec-5dafd636b6afef22a21571bd0af6d334ddb88ed8.tar.gz
msec-5dafd636b6afef22a21571bd0af6d334ddb88ed8.tar.bz2
msec-5dafd636b6afef22a21571bd0af6d334ddb88ed8.tar.xz
msec-5dafd636b6afef22a21571bd0af6d334ddb88ed8.zip
RootSshLogin
-rwxr-xr-xinit-sh/level0.sh1
-rwxr-xr-xinit-sh/level1.sh1
-rwxr-xr-xinit-sh/level2.sh1
-rwxr-xr-xinit-sh/level3.sh1
-rwxr-xr-xinit-sh/level4.sh7
-rwxr-xr-xinit-sh/level5.sh17
-rw-r--r--init-sh/lib.sh13
-rw-r--r--init-sh/lib.sh.usermode14
8 files changed, 33 insertions, 22 deletions
diff --git a/init-sh/level0.sh b/init-sh/level0.sh
index 8d09aff..3cb6b22 100755
--- a/init-sh/level0.sh
+++ b/init-sh/level0.sh
@@ -89,3 +89,4 @@ AllowAutologin
# Boot on a shell / authorize ctrl-alt-del
AllowReboot
AllowUserList
+RootSshLogin 0
diff --git a/init-sh/level1.sh b/init-sh/level1.sh
index 99ce8a3..57db69a 100755
--- a/init-sh/level1.sh
+++ b/init-sh/level1.sh
@@ -90,3 +90,4 @@ AllowAutologin
# Do not boot on a shell
AllowReboot
AllowUserList
+RootSshLogin 1
diff --git a/init-sh/level2.sh b/init-sh/level2.sh
index b2fd33f..d0facdb 100755
--- a/init-sh/level2.sh
+++ b/init-sh/level2.sh
@@ -91,3 +91,4 @@ AllowAutologin
# Do not boot on a shell
AllowReboot
AllowUserList
+RootSshLogin 2
diff --git a/init-sh/level3.sh b/init-sh/level3.sh
index 6d41afc..34ed29a 100755
--- a/init-sh/level3.sh
+++ b/init-sh/level3.sh
@@ -92,3 +92,4 @@ ForbidAutologin
grpconv
AllowUserList
+RootSshLogin 3
diff --git a/init-sh/level4.sh b/init-sh/level4.sh
index 62aa2d6..70f8070 100755
--- a/init-sh/level4.sh
+++ b/init-sh/level4.sh
@@ -127,10 +127,5 @@ ForbidAutologin
# Group were modified in lib.sh...
grpconv
-
-
-
-
-
-
ForbidUserList
+RootSshLogin 4
diff --git a/init-sh/level5.sh b/init-sh/level5.sh
index c894b44..77f35ec 100755
--- a/init-sh/level5.sh
+++ b/init-sh/level5.sh
@@ -148,20 +148,5 @@ echo
# Group were modified in lib.sh...
grpconv
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
ForbidUserList
+RootSshLogin 5
diff --git a/init-sh/lib.sh b/init-sh/lib.sh
index 9fb580f..baf2b4f 100644
--- a/init-sh/lib.sh
+++ b/init-sh/lib.sh
@@ -297,6 +297,19 @@ AllowReboot() {
echo "done."
}
+RootSshLogin () {
+ echo -n "Setting up the root ssh login : "
+ if [[ $1 == 4 || $1 == 5 ]]; then
+ /bin/sed 's/PermitRootLogin yes/PermitRootLogin no/' < /etc/ssh/sshd_config > /etc/ssh/sshd_config.new
+ mv /etc/ssh/sshd_config.new /etc/ssh/sshd_config
+ chmod 0600 /etc/ssh/sshd_config
+ else
+ sed 's/PermitRootLogin no/PermitRootLogin yes/' < /etc/ssh/sshd_config > /etc/ssh/sshd_config.new
+ mv /etc/ssh/sshd_config.new /etc/ssh/sshd_config
+ chmod 0600 /etc/ssh/sshd_config
+ fi
+}
+
# If we are currently installing our
# system with DrakX, we don't ask anything to the user...
# Instead, DrakX do it and give us a file with some variable.
diff --git a/init-sh/lib.sh.usermode b/init-sh/lib.sh.usermode
index 6f1f65e..cb39b61 100644
--- a/init-sh/lib.sh.usermode
+++ b/init-sh/lib.sh.usermode
@@ -287,6 +287,20 @@ AllowReboot() {
echo "done."
}
+RootSshLogin () {
+ echo -n "Setting up the root ssh login : "
+ if [[ $1 == 4 || $1 == 5 ]]; then
+ /bin/sed 's/PermitRootLogin yes/PermitRootLogin no/' < /etc/ssh/sshd_config > /etc/ssh/sshd_config.new
+ mv /etc/ssh/sshd_config.new /etc/ssh/sshd_config
+ chmod 0600 /etc/ssh/sshd_config
+ else
+ sed 's/PermitRootLogin no/PermitRootLogin yes/' < /etc/ssh/sshd_config > /etc/ssh/sshd_config.new
+ mv /etc/ssh/sshd_config.new /etc/ssh/sshd_config
+ chmod 0600 /etc/ssh/sshd_config
+ fi
+}
+
+
# If we are currently installing our
# system with DrakX, we don't ask anything to the user...
# Instead, DrakX do it and give us a file with some variable.