One of the methods to manage OpenWrt is by using a command-line interface over SSH.
OpenWrt listens for incoming SSH connections on port 22/tcp by default. In order to SSH into your router, you can enter the following command in a terminal emulator, using your router's LAN IP address, which is typically 192.168.1.1:
ssh root@192.168.1.1
The first time you SSH into your router, you will probably see a warning about the RSA key fingerprint.
If you are certain this is the address of your OpenWrt device, simply type yes and press Return.
Then enter the password you assigned to your router, or press Return if this is the initial setup.
Here is an example session:
$ ssh root@192.168.1.1
The authenticity of host '192.168.1.1 (192.168.1.1)' can't be established.
RSA key fingerprint is SHA256:4VbDA/MOc7inPiyllF5f0r3Q6iEx89ddKdhLGBovsiY.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.1' (RSA) to the list of known hosts.
root@192.168.1.1's password:
BusyBox v1.28.4 () built-in shell (ash)
  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 18.06.2, r7676-cddd7b4c77
 -----------------------------------------------------
root@OpenWrt:~#
Note: you probably won't see your password as you type it, though that depends on the configuration of your system.
To end the SSH session, type exit and press Return.
The remainder of this page describes several terminal emulators that can be used on Windows, Linux, or macOS to access your OpenWrt device.
Note: To add an SSH public key to your OpenWrt device, see From the LuCI Web Interface
Windows Terminal, PowerShell, and Command Prompt allow using the SSH client. That client is now available by default, however if your version of Windows is older, you may follow this guide to enable SSH.
If you directly launch cmd.exe, powershell.exe or wsl.exe the legacy ConHost terminal will open.
Otherwise, you can install the modern Windows Terminal from the MS store and select any of these shells from there.
ssh root@192.168.1.1 (“ssh” is the command, “root” is the OpenWrt user you are connecting as, and “192.168.1.1” is the IP)C:\Users\yourusername\.ssh\known_hosts and try again.The Windows optional SSH feature also includes an SCP client (to open/edit/download/upload files in OpenWrt via SSH). Alternatively, you can use WinSCP, which is often easier for SCP purposes.
Powershell provides SSH access.
The Windows Subsystem for Linux is a convenient way to run a Linux environment of your choice directly on Windows. It should already have a command-line SSH client preinstalled, for more instructions see the Linux terminal emulators section. For detailed steps on how to install WSL, refer to Microsoft's documentation: https://docs.microsoft.com/en-us/windows/wsl/install
PuTTY gives you command-line access to OpenWrt.
putty.exe on your Windows client, PuTTY's login window will pop up.Session category of PuTTY's login window, look for the field Host Name (or IP address) and enter the IP address (e.g. 192.168.1.1) of your OpenWrt device. Keep the default provided port 22.Open button at the bottom to open a connection. This will pop up a shell window, asking to login as. Log in as root with your password. If you have not yet set a password for “root”, you will not be prompted for one.Setting up key-based authentication.
puttygen.exe. Save the private key to your PC and add the public key to /etc/dropbear/authorized_keys on your OpenWrt device.openwrt.ppk file you created before). It is best to click “Browse...” and select the file via the file dialog.Automating connections.
root.openwrt.lan in Saved Sessions and click the Save button.@ sign, for example call PuTTY with: putty.exe @openwrt.lanWinSCP allows you to browse the OpenWrt file system in a Windows Explorer-like GUI-style.
Installation package or portable executables and install or unzip them on your Windows client.WinSCP.exe, WinSCP's login window will pop up.New Site on the left, ensure File protocol is set to scp then enter the IP address of your OpenWrt device (usually 192.168.1.1) on the right side into Host name, keep the default port 22. In User name enter root, in Password, enter your root password (or leave blank if you have not set a password yet)Login at the bottom of the window.Editing OpenWrt config files with WinSCP's integrated GUI editor.
Edit from the context menu.Cmder for Windows is an open-source terminal emulator that runs on Windows. It is free to use and provides an easy command line shell that allows you to SSH into OpenWrt. The Full distribution is preferred (over the mini distribution), since it provides bash emulation and a Unix-y suite of commands.
ssh root@192.168.1.1 then press Return.SmarTTY gives you command line access to OpenWrt and allows you to open/edit/download/upload files in OpenWrt, and is overall more modern and user-friendly.
opkg update && opkg install openssh-sftp-server to install it. If the next step fails, it might be necessary to reboot the OpenWrt device for this new service to start up properly.After the first time you connected to a device, SmarTTY saved a profile, so you can connect again to the same device by just double-clicking its icon on the first window you see when starting SmarTTY. You can right-click on this profile icon to edit it again, if needed.
Most Linux distributions provide a command-line SSH client as part of the default installation.
ssh root@192.168.1.1Linux also usually has SCP/SFTP clients (to open/edit/download/upload files in OpenWrt), which may or may not be installed by default.
Midnight Commander is a Norton Commander-like file manager that works on Linux and macOS. You can access remote files on OpenWrt via mc:
Internally, it works over a protocol similar to SCP, called FISH, so it doesn't require an installed SFTP server.
On macOS (formerly Mac OSX) any terminal emulator will allow you to SSH.
To SSH into your OpenWrt router at 192.168.1.1, type ssh root@192.168.1.1, then press Return.
On ChromeOS, the Secure Shell App will allow you to SSH.