login 1009 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/sh
  2. # Copyright (C) 2008 OpenWrt.org
  3. bl_option=/sbin/bl-option
  4. if [ ! -f $bl_option ] ||
  5. [ ! `$bl_option --get-telnet-enabled` ] ||
  6. [ `$bl_option --get-telnet-enabled` = "0" ]; then
  7. echo \
  8. "
  9. === IMPORTANT ==========================
  10. Telnet login is disabled for security
  11. reasons. Enabling telnet login on the
  12. host will allow any user connected to
  13. the same network to login to the host.
  14. You can enable telnet login with the
  15. following command in the host console:
  16. # $bl_option -T 1
  17. You can disable telnet login with the
  18. following command in the host console:
  19. # $bl_option -T 0
  20. ----------------------------------------
  21. "
  22. exit 0
  23. fi
  24. grep '^root:[^!]' /etc/passwd >&- 2>&-
  25. [ "$?" = "0" -a -z "$FAILSAFE" ] &&
  26. {
  27. echo "Login failed."
  28. exit 0
  29. } || {
  30. cat << EOF
  31. === IMPORTANT ============================
  32. Use 'passwd' to set your login password
  33. this will disable telnet and enable SSH
  34. ------------------------------------------
  35. EOF
  36. }
  37. exec /bin/ash --login