Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
docs:guide-quick-start:sshadministration [2020/11/28 02:16] – [Chrome OS terminal emulator] vgaeteradocs:guide-quick-start:sshadministration [2022/08/05 18:08] – [Windows terminal emulators] added external link and cleanup palebloodsky
Line 1: Line 1:
 ====== SSH access for newcomers ====== ====== SSH access for newcomers ======
-OpenWrt listens for incoming SSH connections on address ''192.168.1.1'' port ''22/tcp'' by default. +One of the methods to manage OpenWrt is using [[docs:guide-user:base-system:user.beginner.cli|command-line interface]] over [[wp>SSH_(Secure_Shell)|SSH]]. 
-To "ssh into your router", you can enter the following command in a terminal emulator:+OpenWrt listens for incoming SSH connections on port ''22/tcp'' by default. 
 +To "ssh into your router", you can enter the following command in a terminal emulator using you router's LAN IP address that is typically ''192.168.1.1'':
  
 <code bash> <code bash>
Line 13: Line 14:
  
 <code> <code>
-$ ssh root@192.168.1.1                                                    <== You type this+$ ssh root@192.168.1.1                                          <== You type this
 The authenticity of host '192.168.1.1 (192.168.1.1)' can't be established. The authenticity of host '192.168.1.1 (192.168.1.1)' can't be established.
 RSA key fingerprint is SHA256:4VbDA/MOc7inPiyllF5f0r3Q6iEx89ddKdhLGBovsiY. RSA key fingerprint is SHA256:4VbDA/MOc7inPiyllF5f0r3Q6iEx89ddKdhLGBovsiY.
-Are you sure you want to continue connecting (yes/no)? yes                <== and this+Are you sure you want to continue connecting (yes/no)? yes      <== and this
 Warning: Permanently added '192.168.1.1' (RSA) to the list of known hosts. Warning: Permanently added '192.168.1.1' (RSA) to the list of known hosts.
-root@192.168.1.1's password:                                              <== and the password here+root@192.168.1.1's password:                                    <== and the password here
  
 BusyBox v1.28.4 () built-in shell (ash) BusyBox v1.28.4 () built-in shell (ash)
Line 31: Line 32:
  -----------------------------------------------------  -----------------------------------------------------
  
-root@OpenWrt:~#                                                           <== type next command here+root@OpenWrt:~#                                                 <== type next command here
 </code> </code>
  
Line 38: Line 39:
 The remainder of this page describes several terminal emulators that Windows, Linux, or macOS can use to access your OpenWrt device. The remainder of this page describes several terminal emulators that Windows, Linux, or macOS can use to access your OpenWrt device.
  
 +//Note: To add a SSH public key to your OpenWrt device, see [[:docs:guide-user:security:dropbear.public-key.auth#From the LuCI Web Interface]]//
 ===== Windows terminal emulators ===== ===== Windows terminal emulators =====
-Windows Terminal for Windows 10 or the legacy ConHost (both giving access to Windows PowerShell, Windows Command Prompt, WSL Bash), PuTTY, Cmder, SmarTTY, and WinSCP are terminal emulators that allow you to SSH into an OpenWrt router.+[[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.
  
 ==== Windows 10 built-in terminals ==== ==== Windows 10 built-in terminals ====
-Both Windows PowerShell and Command Prompt allows to use the default Windows 10 SSH client.+Both Windows PowerShell and Command Prompt allows using the default Windows 10 SSH client.
 That SSH client is an optional windows feature and has to be [[https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse|enabled]]. That SSH client is an optional windows feature and has to be [[https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse|enabled]].
  
Line 57: Line 59:
 The Windows 10 optional SSH feature also includes SCP client (to open/edit/download/upload files in OpenWrt via SSH). The Windows 10 optional SSH feature also includes SCP client (to open/edit/download/upload files in OpenWrt via SSH).
 Try google for some SCP tutorials to learn how to use it. Try google for some SCP tutorials to learn how to use it.
-Otherwise, use [[:docs:guide-quick-start:sshadministration#using_winscp|WinSCP]] which is way easier for SCP purposes.+Otherwise, use [[docs:guide-quick-start:sshadministration#winscp|WinSCP]] which is way easier for SCP purposes.
  
 ==== PowerShell ==== ==== PowerShell ====
 [[https://devblogs.microsoft.com/powershell/announcing-PowerShell-7-0/|Powershell]] provides SSH access. [[https://devblogs.microsoft.com/powershell/announcing-PowerShell-7-0/|Powershell]] provides SSH access.
 +
 +==== Windows Subsystem for Linux (WSL) ====
 +The Windows Subsystem for Linux is a convenient way to run a Linux environment of your choice including most,command-line tools, utilities, and applications directly on Windows. For detailed steps of how to install WSL on Windows 10, refer to Microsoft's documentation: https://docs.microsoft.com/en-us/windows/wsl/install-win10
  
 ==== PuTTY ==== ==== PuTTY ====
-PuTTY gives you command line access to OpenWrt.+PuTTY gives you command-line access to OpenWrt.
  
   - Download [[https://www.putty.org/|PuTTY]], get the 32bit ''putty.exe'' from the ''Alternative binary files'' section.   - Download [[https://www.putty.org/|PuTTY]], get the 32bit ''putty.exe'' from the ''Alternative binary files'' section.
Line 70: Line 75:
   - 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.   - 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.
   - Done, you are logged into the OpenWrt command line.   - Done, you are logged into the OpenWrt command line.
 +
 +Setting up key-based authentication.
 +
 +  - 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.
 +  - 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.
 +
 +  - Connection -> Data: In the box "Login details" enter the "Auto-login username" which is ''root''.
 +  - Load, save or delete a stored session, enter ''openwrt.lan'' in Saved Sessions and click the Save button.
 +  - 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''
  
 ==== WinSCP ==== ==== WinSCP ====
Line 76: Line 92:
   - Download [[https://winscp.net/eng/download.php|WinSCP]], get the non-beta ''Installation package'' or ''portable executables'' and install or unzip them on your Windows client   - Download [[https://winscp.net/eng/download.php|WinSCP]], get the non-beta ''Installation package'' or ''portable executables'' and install or unzip them on your Windows client
   - Start ''WinSCP.exe'' on your Windows client, WinSCP's login window will pop up   - Start ''WinSCP.exe'' on your Windows client, WinSCP's login window will pop up
-  - Click on ''New Site'' on the left, then enter your OpenWrt device IP address (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)+  - Click on ''New Site'' on the left, ensure ''File protocol'' is set to **scp** then enter your OpenWrt device IP address (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)
   - Click the ''Login'' at the bottom of the Window.   - Click the ''Login'' at the bottom of the Window.
   - Done. You now have an Exlorer-like view of your OpenWrt file system.   - Done. You now have an Exlorer-like view of your OpenWrt file system.
Line 82: Line 98:
 Editing OpenWrt config files with WinSCP's integrated GUI editor. Editing OpenWrt config files with WinSCP's integrated GUI editor.
  
-  - To edit OpenWrt config file with WinSCP's GUI-based editor, just right-click the file in WinSCP and select ''Edit'' from the context menu.+  - To edit an OpenWrt config file with WinSCP's GUI-based editor, just right-click the file in WinSCP and select ''Edit'' from the context menu.
  
 ==== Cmder ==== ==== Cmder ====
Line 121: Line 137:
   - if you want to close the session, write "exit"   - if you want to close the session, write "exit"
  
-Linux also usually has SCP clients (to open/edit/download/upload files in OpenWrt), which may or may not be installed by default. +Linux also usually has SCP/SFTP clients (to open/edit/download/upload files in OpenWrt), which may or may not be installed by default. 
-You need to look up your distro's documentation or search with your package management interface for "SCP" to find where it is and its current installation status. +You need to look up your distro's documentation or search with your package management interface for "scp" and "sftp" to find where it is and its current installation status. 
-Read its integrated manual ("man scp" for example is for the command line SCP clientor google some tutorials to learn how to use it.+Read [[man>scp|scp manual]] for the command line SCP client or google some tutorials to learn how to use it
 + 
 +==== Midnight Commander ==== 
 +[[https://midnight-commander.org/|Midnight Commander]] is Norton Commander like file manager that works on Linux and macOS. 
 +You can access remote files on OpenWrt via mc: 
 + 
 +  - Press 'F9' 
 +  - Select 'Left' panel config 
 +  - Select 'Shell link' 
 +  - Input 'root@192.168.1.1/' and press OK 
 +  - Now you'll see list of files and directories in root of OpenWrt 
 + 
 +Internally it works over [[wp>Files_transferred_over_shell_protocol|scp like protocol FISH]] so it not needs for installed SFTP server.
  
 ===== macOS terminal emulators ===== ===== macOS terminal emulators =====
  • Last modified: 2022/08/05 19:30
  • by palebloodsky