Command-line access to OpenWrt

19,926次阅读

PuTTY gives you command-line access to OpenWrt.

  1. Download PuTTY, get the 32bit(or 64bit) putty.exe from the Alternative binary files section.
  2. Start putty.exe on your Windows client → PuTTY’s login window pops up.
  3. go to the Session category of PuTTY’s login window, look for the field Host Name (or IP address) and simply enter the IP-address (e.g. 192.168.1.1) of your OpenWrt device, keep the default provided port 22.
  4. Click the Open button at the Bottom to open a connection. This will pop up a shell windows, asking to login as. Login as root with the OpenWrt password you have defined some time before. If you have not yet set a password yet on “root”, you will not be asked for the password.
  5. Done, you are logged into the OpenWrt command line.

Setting up key-based authentication.

  1. Generate a key pair using puttygen.exe. Save the private key to the PC and add the public key to /etc/dropbear/authorized_keys on your OpenWrt device.
  2. Connection → SSH → Auth: In the box “Authentication Parameters” under “Private key file for Authentication” state the path to your private key file for this connection (e.g. the openwrt.ppk file you created before). Best is to click “Browse…” and select the file via the file dialog.

Automating connections.

  1. Connection → Data: In the box “Login details” enter the “Auto-login username” which is root.
  2. Load, save or delete a stored session, enter openwrt.lan in Saved Sessions and click the Save button.
  3. To make a PuTTY shortcut with an automatic login, create one and append the saved session with an @ sign, for example call PuTTY with: putty.exe @openwrt.lan
正文完