Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| docs:guide-quick-start:sshadministration [2018/11/11 18:53] – Fixed typo in inter-wiki links jw0914 | docs:guide-quick-start:sshadministration [2022/08/05 18:08] – [Windows terminal emulators] added external link and cleanup palebloodsky | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== SSH Access | + | ====== SSH access |
| + | One of the methods to manage OpenWrt is using [[docs: | ||
| + | OpenWrt listens for incoming SSH connections on port '' | ||
| + | To "ssh into your router", | ||
| - | This wiki describes several terminal emulators to initiate a SSH connection on [[sshadministration# | + | <code bash> |
| - | * To SSH into your router with [[https:// | + | ssh root@192.168.1.1 |
| - | * **Default Port:** 22 | + | </ |
| - | * **// | + | |
| - | * **// | + | |
| - | * //The first time you SSH into your router, you will see a warning about the SSH server' | + | |
| - | * If you are certain this is the address of your OpenWrt router, type '' | + | |
| - | * To end your SSH session, type <wrap lo>'' | + | |
| - | <WRAP indent> | + | The first time you ssh into your router, you will probably see a warning about the //RSA key fingerprint// |
| - | === Example === | + | If you are certain this is the address of your OpenWrt device, simply type '' |
| - | <WRAP 57em lo>< | + | Then enter the password you have given to your router, or press Return if this is the initial setup. |
| - | $ ssh root@192.168.1.1 | + | Here is an example session: |
| - | The authenticity of host ' | + | < |
| + | $ ssh root@192.168.1.1 | ||
| + | The authenticity of host ' | ||
| RSA key fingerprint is SHA256: | RSA key fingerprint is SHA256: | ||
| - | Are you sure you want to continue connecting (yes/no)? yes | + | Are you sure you want to continue connecting (yes/no)? yes < |
| Warning: Permanently added ' | Warning: Permanently added ' | ||
| - | root@192.168.1.1 password: | + | root@192.168.1.1' |
| - | BusyBox v1.28.3 () built-in shell (ash) | + | BusyBox v1.28.4 () built-in shell (ash) |
| - | Enter ' | + | |
| _______ | _______ | ||
| Line 31: | Line 29: | ||
| |__| W I R E L E S S F R E E D O M | |__| W I R E L E S S F R E E D O M | ||
| | | ||
| - | | + | |
| | | ||
| - | root@OpenWrt: | + | root@OpenWrt: |
| - | </code></ | + | </ |
| - | </WRAP> | + | |
| + | To end your //ssh session// to your router, type '' | ||
| - | ===== BSD/MacOS ===== | + | The remainder of this page describes several terminal emulators that Windows, Linux, or macOS can use to access your OpenWrt device. |
| - | <wrap button lo>[[https://raw.githubusercontent.com/JW0914/Wikis/master/Scripts%2BConfigs/OpenSSH/ | + | //Note: To add a SSH public key to your OpenWrt device, see [[: |
| + | ===== Windows terminal emulators ===== | ||
| + | [[https://github.com/microsoft/terminal|Windows Terminal]] or the legacy PowerShell, Command Prompt, ConHost, or WSL Bash choices are available. Third party programs such as [[https://www.putty.org/|PuTTY]], MinGW (installed with Git), Cmder, SmarTTY, and WinSCP are also terminal emulators that can provide SSH into an OpenWrt router. | ||
| - | * **All UNIX-based distributions provide a command-line | + | ==== Windows 10 built-in terminals ==== |
| - | * Terminal | + | Both Windows PowerShell and Command Prompt allows using the default Windows 10 SSH client. |
| - | * [[https://iterm2.com/|iTerm2]] is an enhanced terminal program\\ \\ | + | That SSH client |
| - | * It's recommended to read the integrated manual for the program(s) | + | |
| - | * Terminal: <wrap lo>'' | + | |
| - | * Search Engine: <wrap lo>'' | + | |
| + | If you have installed a WSL distribution, | ||
| - | ===== Linux ===== | + | If you directly launch '' |
| + | Otherwise, you can install the modern [[https:// | ||
| - | <wrap button lo> | + | - Open any of the above terminal emulators and write '' |
| + | - there will be a message about accepting a new key from the OpenWrt device, write " | ||
| + | - If for some reason you have reinstalled OpenWrt the device will have a different key and you get an error about key mismatch. The error will state what is the command line to copy-paste in your terminal to delete the old key and proceed. Do it and retry. | ||
| + | | ||
| - | * **All UNIX-based distributions provide a command-line | + | The Windows 10 optional |
| - | * The distro' | + | Try google |
| - | * It's recommended | + | Otherwise, use [[docs:guide-quick-start:sshadministration# |
| - | * Terminal: <wrap lo>'' | + | |
| - | * Search Engine: <wrap lo>'' | + | |
| + | ==== PowerShell ==== | ||
| + | [[https:// | ||
| - | ===== Windows ===== | + | ==== Windows |
| + | The Windows Subsystem for Linux is a convenient way to run a Linux environment of your choice including most, | ||
| - | <wrap button lo> | + | ==== PuTTY ==== |
| - | * **[[sshadministration# | + | PuTTY gives you command-line access |
| - | * OpenSSH has been ported over to Windows by Microsoft | + | |
| - | * Installation should be pulled directly from Microsoft' | + | |
| - | * //Do not utilize Windows' | + | |
| - | * [[https:// | + | |
| - | <WRAP indent> | + | - Download [[https:// |
| - | ==== Cmder ==== | + | - Start '' |
| + | - go to the '' | ||
| + | - Click the '' | ||
| + | - Done, you are logged into the OpenWrt command line. | ||
| - | <wrap button lo> | + | Setting up key-based authentication. |
| - | | + | - Generate a key pair using '' |
| - | * Full distribution is preferred over the mmini, as it provides bash emulation | + | - Connection |
| - | - Download, and once installed, open Cmder | + | |
| - | | + | |
| - | - // | + | |
| - | ==== ConEmu ==== | + | Automating connections. |
| - | <wrap button lo>[[https://mridgers.github.io/ | + | - Connection -> Data: In the box "Login details" |
| + | - Load, save or delete a stored session, enter '' | ||
| + | - To make a PuTTY shortcut with an automatic login, create one and append the saved session with an '' | ||
| - | * **ConEmu is a fully customizable terminal emulator for Windows capable of hosting any application developed for:** | + | ==== WinSCP ==== |
| - | * **// | + | WinSCP allows you to browse |
| - | * **//Unix PTY//:** <wrap lo>'' | + | |
| - | - Download, and once ConEmu & CLink are installed, open ConEmu | + | |
| - | * //Install CLink to <wrap lo>'' | + | |
| - | - ConEmu auto opens the **//Create New Console//** window | + | |
| - | | + | |
| - | - Issue: <wrap lo>'' | + | |
| - | - //Assumes you have installed [[sshadministration# | + | |
| + | - Download [[https:// | ||
| + | - Start '' | ||
| + | - Click on '' | ||
| + | - Click the '' | ||
| + | - Done. You now have an Exlorer-like view of your OpenWrt file system. | ||
| - | ==== PuTTY ==== | + | Editing OpenWrt config files with WinSCP' |
| + | |||
| + | - To edit an OpenWrt config file with WinSCP' | ||
| + | |||
| + | ==== Cmder ==== | ||
| + | Cmder for Windows is an open-source terminal emulator that runs on Windows. | ||
| + | It is free to use and provides an easy " | ||
| + | Its attractive fonts and color scheme are easy on the eyes. | ||
| + | The //Full// distribution is preferred (over the //mini// distribution), | ||
| - | <wrap button lo>[[https://www.chiark.greenend.org.uk/~sgtatham/ | + | - Download |
| + | - Unzip the //cmder.zip// file. | ||
| + | - Open the Cmder folder, and double-click the Cmder icon. You'll see a Cmder window open similar to the image below. | ||
| + | - To ssh into the OpenWrt | ||
| - | * **PuTTY provides command line access to OpenWrt via SSH and other methods** | ||
| - | - Download, and once installed, open PuTTY | ||
| - | - **//Session Category// | ||
| - | - **//Host Name (or IP)//:** <wrap lo>'' | ||
| - | - Click **// | ||
| - | - Enter password if set | ||
| - | - Done: you are now logged into the OpenWrt command line | ||
| - | | ||
| - | | ||
| ==== SmarTTY ==== | ==== SmarTTY ==== | ||
| + | SmarTTY gives you command line access to OpenWrt and allows you to open/ | ||
| - | <wrap button lo>[[http://smartty.sysprogs.com/ | + | - Download |
| + | - after installation or after unzipping the archive, doubleclick on **SmarTTY** executable file. | ||
| + | - You will be greeted by a window with two choices, doubleclick on "setup a new SSH connection" | ||
| + | - The window changes into the SSH setup, write the following info: | ||
| + | - **Host name:** OpenWrt device IP address (default is **192.168.1.1** ) | ||
| + | - **User Name:** **root** (this is the " | ||
| + | - **Password: | ||
| + | - Click " | ||
| + | - A default OpenWrt firmware lacks the server component to allow you to open/edit/ | ||
| + | - Now you can click on **File -> Open a Remote File** to open a popup that shows the file system of the OpenWrt device, and you can navigate in it and open text files for example as normal (they will open in a SmarTTY text editor window) | ||
| + | - If you want to upload or download files to/from a specific folder in the device, you can click on SCP menu and choose the most appropriate action from there. | ||
| - | <wrap danger> | + | After the first time you connected to a device, SmarTTY |
| - | * **SmarTTY is a more modern and user-friendly terminal emulator than PuTTY** | + | You can right-click on this profile icon to edit it again, if needed. |
| - | - Download, and once installed, open SmarTTY | + | |
| - | - Choose **// | + | |
| - | - **//Host name//:** <wrap lo>'' | + | |
| - | - **//User Name//:** <wrap lo>'' | + | |
| - | - **// | + | |
| - | - Click **// | + | |
| - | - Configure for SCP, in lieu of SFTP | + | |
| - | - Click **//File <wrap em> | + | |
| - | * Allows navigation of the OpenWrt filesystem and editing of config files | + | |
| - | - To upload/ | + | |
| + | ===== Linux terminal emulators ===== | ||
| + | All Linux distributions provide a command-line ssh client as part of the default installation. | ||
| - | ==== WinSCP | + | - Open a terminal emulator and write '' |
| + | - there will be a message about accepting a new key from the OpenWrt device, write " | ||
| + | - If for some reason you have reinstalled OpenWrt the device will have a different key and you get an error about key mismatch. The error will state what is the command line to copy-paste in your terminal to delete the old key and proceed. | ||
| + | - if you want to close the session, write " | ||
| + | |||
| + | Linux also usually has SCP/SFTP clients (to open/ | ||
| + | You need to look up your distro' | ||
| + | Read [[man> | ||
| + | |||
| + | ==== Midnight Commander | ||
| + | [[https:// | ||
| + | You can access remote files on OpenWrt via mc: | ||
| + | |||
| + | - Press ' | ||
| + | - Select ' | ||
| + | - Select 'Shell link' | ||
| + | - Input ' | ||
| + | - Now you'll see list of files and directories in root of OpenWrt | ||
| + | |||
| + | Internally it works over [[wp> | ||
| + | |||
| + | ===== macOS terminal emulators ===== | ||
| + | On macOS (formerly Mac OSX) any terminal emulator will allow you to ssh. | ||
| - | <wrap button lo>[[https://winscp.net/eng/ | + | - Terminal - The macOS built-in terminal program, find it in / |
| + | - [[https://iterm2.com/|iTerm2]] a much-enhanced terminal program, donation-ware - it's worth it. | ||
| - | * **WinSCP allows browsing of the OpenWrt | + | To ssh into your OpenWrt |
| - | - Download, and once installed, open WinSCP | + | |
| - | - Click **//New Site//** on left, then enter: | + | |
| - | - **//File Protocol//: | + | |
| - | - **//Host name//:** <wrap lo>'' | + | |
| - | - **//User name//:** <wrap lo>'' | + | |
| - | - **// | + | |
| - | - Click **// | + | |
| - | - Done: you now have an Explorer-like view of the OpenWrt filesystem | + | |
| - | * To edit files, right-click file in WinSCP, select <wrap lo>'' | + | |
| - | </WRAP> | + | ===== Chrome OS terminal emulator ===== |
| + | On Chrome OS, [[https:// | ||