openwrt/package/base-files/files/bin/login.sh
Steven Barth d196b1fc2e Disable telnet in favor of passwordless SSH
This enables passworldless login for root via SSH whenever no root
password is set (e.g. after reset, flashing without keeping config
or in failsafe) and removes telnet support alltogether.

Signed-off-by: Steven Barth <steven@midlink.org>

SVN-Revision: 46809
2015-09-07 19:29:25 +00:00

19 lines
383 B
Bash
Executable File

#!/bin/sh
# Copyright (C) 2006-2011 OpenWrt.org
if ( ! grep -qsE '^root:[!x]?:' /etc/shadow || \
! grep -qsE '^root:[!x]?:' /etc/passwd ) && \
[ -z "$FAILSAFE" ]
then
echo "Login failed."
exit 0
else
cat << EOF
=== IMPORTANT ============================
Use 'passwd' to set your login password!
------------------------------------------
EOF
fi
exec /bin/ash --login