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:user-guide:services:nas:sftp.server [2018/03/03 20:05] – ↷ Page moved from docs:user-guide:services:sftp.server to docs:user-guide:services:nas:sftp.server bobafetthotmaildocs:guide-user:services:nas:sftp.server [2023/03/04 11:21] – [Popular clients] stokito
Line 1: Line 1:
 ====== SFTP server ====== ====== SFTP server ======
 +{{section>meta:infobox:howto_links#basic_skills&noheader&nofooter&noeditbutton}}
  
-Some clients, e.g. GNOME Files or [[https://cyberduck.io|Cyberduck]] on the Mac, cannot connect to the SCP server provided by OpenWrt's standard ssh server, dropbear, unless an additional binary is installed in /usr/libexec/sftp-server - this can be done with:+===== Introduction ===== 
 +  * This how-to describes the method for setting up [[wp>SSH_File_Transfer_Protocol|SFTP]] server on OpenWrt
 +  * It relies on [[docs:guide-user:base-system:dropbear|Dropbear]] and [[packages:pkgdata:openssh-sftp-server]] for secure authentication and file transfer. 
 +  * You can use any suitable [[docs:guide-user:services:nas:sftp.server#popular_clients|SFTP client]] running natively on your OS.
  
-  # Enable sftp, work around https://trac.cyberduck.io/ticket/4161 +===== Goals ===== 
-  opkg update +  * Transfer files to/from the router
-  opkg install openssh-sftp-server+  * Secure file transfer operations. 
 +  * Support OS specific clients.
  
-Now you can use sftp clients such as GNOME Files or Cyberduck to connect to the OpenWrt system. Note that no additional startup scripts are required since all of that is handled by dropbear which is most likely already present on your system.+===== Instructions ===== 
 +The SSH File Transfer (SFTP) is a file transfer protocol that works over SSH. It's like SCP but has more features. 
 +For a basic usage the low level SCP may be enough but if you need, for example, to mount drive then use the SFTP.
  
-===== Announce on the network =====+The vanilla OpenWrt out of the box has a small [[docs:guide-user:base-system:dropbear|Dropbear]] SSH server. 
 +But it doesn't support the SFTP and you need to install ''openssh-sftp-server'' package. 
 +The package comes from another OpenSSH server which is bigger but has more features and default on desktop systems like Ubuntu. 
 +Many [[docs:guide-user:installation:openwrt-as-stock-firmware|routers with OpenWrt as a stock firmware]] use it out of the box and the ''openssh-sftp-server'' is installed too. 
 +So for this routers you really don't need anything to do and just start using it.
  
 +But if not then install the required package:
  
-If you would like to announce the service on the network using Bonjour/Zeroconf so that Cyberduck finds it, you you can install the announce package, starting from Chaos Calmer+<code bash> 
-  opkg install announce +opkg update 
-  /etc/init.d/announce enable +opkg install openssh-sftp-server 
-  /etc/init.d/announce start +</code> 
-   + 
-announce will notice that openssh-sftp-server is present and will announce the sftp service on the network.+===== Testing ===== 
 +Enter the following URL in your SFTP client. 
 + 
 +<code bash> 
 +sftp://root@openwrt.lan/ 
 +</code> 
 + 
 +===== Troubleshooting ===== 
 +Collect and analyze the following information. 
 + 
 +<code bash> 
 +# Restart services 
 +/etc/init.d/log restart; /etc/init.d/dropbear restart 
 + 
 +# Log and status 
 +logread -e dropbear; netstat -l -n -p | grep -e dropbear 
 + 
 +# Runtime configuration 
 +pgrep -f -a dropbear 
 + 
 +# Persistent configuration 
 +uci show dropbear 
 +ls -l /etc/dropbear; cat /etc/dropbear/authorized_keys 
 +ls -l $(opkg files openssh-sftp-server | grep -e ^/) 
 +</code> 
 + 
 +===== Extras ===== 
 +==== Popular clients ==== 
 +  * Windows: [[docs:guide-quick-start:sshadministration#winscp|WinSCP]] - an advanced GUI client. ''Proprietary'' 
 +  * Windows: [[https://www.farmanager.com/|FAR Manager]] - an advanced Norton Commander like file manager. Supports a plain SCP too. ''Proprietary'' 
 +  * Linux, macOS, FreeBSD: [[https://github.com/elfmz/far2l|far2l]] - an open source version of the FAR. ''GPL-2'' 
 +  * Linux, macOS, FreeBSD: [[https://midnight-commander.org/|Midnight Commander]] - a Norton Commander like file manager. Supports a plain SCP too. ''GPL-3'' 
 +  * Linux: [[wp>GNOME_Files|GNOME Files]] or [[https://apps.kde.org/ru/konqueror/|KDE Konqueror]]. ''GPL-2'' 
 +  * Linux: [[https://wiki.gnome.org/Apps/DejaDup/Details|GNOME Déjà Dup]] - a backup and sync tool. ''GPL-3'' 
 +  * Windows, macOS, Linux, FreeBSD: [[https://rclone.org/|rclone]] - a command-line program to manage files on cloud storage. ''MIT'' 
 +  * macOS: [[https://cyberduck.io/|Cyberduck]] and [[https://mountainduck.io/|MountainDuck]]. ''GPL-3''
 +  * Android: [[https://play.google.com/store/apps/details?id=com.lonelycatgames.Xplore|X-plore File Manager]] 
 +  * Android TV, RapberryPI: [[https://kodi.tv|KODI]] - a media player for TV. You can put a USB drive to a router and watch your photos, video and audio without any additional software. 
 +  * [[https://www.sftp.net/clients|SFTP Client]] list 
 + 
 +==== Service discovery ==== 
 +You may want to provide service discovery for clients supporting Bonjour/Zeroconf. 
 + 
 +<code bash> 
 +opkg update 
 +opkg install announce 
 +</code> 
 + 
 +See also [[docs:guide-developer:mdns|umdns Multicast DNS Daemon]]
  • Last modified: 2023/10/14 05:25
  • by vgaetera