summaryrefslogtreecommitdiffstats
path: root/recipes/busybox/files/login.failsafe
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/busybox/files/login.failsafe')
-rw-r--r--recipes/busybox/files/login.failsafe19
1 files changed, 19 insertions, 0 deletions
diff --git a/recipes/busybox/files/login.failsafe b/recipes/busybox/files/login.failsafe
new file mode 100644
index 0000000000..e7c12a27fb
--- /dev/null
+++ b/recipes/busybox/files/login.failsafe
@@ -0,0 +1,19 @@
+#!/bin/sh
+# Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2008 Koen Kooi
+
+grep '^root:[^!]' /etc/passwd >&- 2>&-
+[ "$?" = "0" ] &&
+{
+ echo "Login failed."
+ exit 0
+} || {
+cat << EOF
+ === IMPORTANT ============================
+ Use 'passwd' to set your login password
+ this will disable telnet and enable SSH
+ ------------------------------------------
+EOF
+}
+
+exec /bin/sh --login