Disable telnet in favor of passwordless SSH
[openwrt/openwrt.git] / package / base-files / files / lib / preinit / 99_10_failsafe_login
index 05d6b7787b69c7a6cdf611505a04d43443be1cf2..b12e31702ab61637f9b02d2ea25c3c1a1d5116d1 100644 (file)
@@ -1,18 +1,17 @@
 #!/bin/sh
-# Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2006-2015 OpenWrt.org
 # Copyright (C) 2010 Vertical Communications
 
 failsafe_netlogin () {
-    telnetd -l /bin/login.sh <> /dev/null 2>&1    
+       dropbearkey -t rsa -s 1024 -f /tmp/dropbear_failsafe_host_key
+       dropbear -r /tmp/dropbear_failsafe_host_key <> /dev/null 2>&1
 }
 
 failsafe_shell() {
-    lock /tmp/.failsafe
-    ash --login
-    echo "Please reboot system when done with failsafe network logins"
+       lock /tmp/.failsafe
+       ash --login
+       echo "Please reboot system when done with failsafe network logins"
 }
 
-
 boot_hook_add failsafe failsafe_netlogin
 boot_hook_add failsafe failsafe_shell
-