Login configuration

  1. Setting the password on the WRT54G

    user@PC:~$ telnet 192.168.1.1
    telnet 192.168.1.1
    Trying 192.168.1.1...
    Connected to 192.168.1.1.
    Escape character is '^]'.
    === IMPORTANT ============================
    Use 'passwd' to set your login password
    this will disable telnet and enable SSH
    ------------------------------------------


    BusyBox v1.15.3 (2010-04-06 04:08:20 CEST) built-in shell (ash)
    Enter 'help' for a list of built-in commands.

    _______                     ________        __
    |       |.-----.-----.-----.|  |  |  |.----.|  |_
    |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
    |_______||   __|_____|__|__||________||__|  |____|
    |__| W I R E L E S S   F R E E D O M
    Backfire (10.03, r20728) --------------------------
    * 1/3 shot Kahlua    In a shot glass, layer Kahlua
    * 1/3 shot Bailey's  on the bottom, then Bailey's,
    * 1/3 shot Vodka     then Vodka.
    ---------------------------------------------------
    root@OpenWrt:/# passwd
    Changing password for root
    New password:
    Retype password:
    Password for root changed by root
    root@OpenWrt:/# Connection closed by foreign host.
    user@PC:~$ ssh  root@192.168.1.1
    root@192.168.1.1's password:


    BusyBox v1.15.3 (2010-04-06 04:08:20 CEST) built-in shell (ash)
    Enter 'help' for a list of built-in commands.

    _______                     ________        __
    |       |.-----.-----.-----.|  |  |  |.----.|  |_
    |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
    |_______||   __|_____|__|__||________||__|  |____|
    |__| W I R E L E S S   F R E E D O M
    Backfire (10.03, r20728) --------------------------
    * 1/3 shot Kahlua    In a shot glass, layer Kahlua
    * 1/3 shot Bailey's  on the bottom, then Bailey's,
    * 1/3 shot Vodka     then Vodka.
    ---------------------------------------------------
    root@OpenWrt:~#                         

  2. Allowing SSH on WAN

    Edit /etc/config/firewall:

      <snip>
      config rule
      option proto            tcp
      option src              wan
      option dest_port        22
      option target           ACCEPT
      <snip>
    	  

  3. Using only keys for SSH

    Create a keypair, and copy it to the router:

    ... then on the router, move /root/.ssh/authorized_keys to /etc/dropbear, and disable password authentication in /etc/configure/dropbear:

    ... don't log out yet! and try the connection:

    [Note]Note

    If you did log out, and cannot get back in, you still have the web interface to re-enable password authentication for SSH or reset the password entirely.