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-user:services:nas:sftp.server [2023/01/16 09:50] – reorganize content vgaeteradocs: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#cli_skills&noheader&nofooter&noeditbutton}}+{{section>meta:infobox:howto_links#basic_skills&noheader&nofooter&noeditbutton}}
  
 ===== Introduction ===== ===== Introduction =====
-  * This how-to describes the method for setting up SFTP server on OpenWrt. +  * 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]]. +  * 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 native SFTP clients such as: +  * You can use any suitable [[docs:guide-user:services:nas:sftp.server#popular_clients|SFTP client]] running natively on your OS.
-    * [[https://apps.gnome.org/app/org.gnome.Nautilus/|GNOME Files]] on Linux, +
-    * [[https://cyberduck.io|Cyberduck]] on macOS, +
-    * [[docs:guide-quick-start:sshadministration#winscp|WinSCP]] on Windows.+
  
 ===== Goals ===== ===== Goals =====
   * Transfer files to/from the router.   * Transfer files to/from the router.
-  * Follow Dropbear authentication settings+  * Secure file transfer operations
-  * Support multiple native SFTP clients.+  * Support OS specific clients.
  
 ===== Instructions ===== ===== Instructions =====
-Install the required packages.+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. 
 + 
 +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:
  
 <code bash> <code bash>
-# Install packages 
 opkg update opkg update
 opkg install openssh-sftp-server opkg install openssh-sftp-server
Line 25: Line 30:
  
 ===== Testing ===== ===== Testing =====
-Enter the following address in your SFTP client.+Enter the following URL in your SFTP client.
  
 <code bash> <code bash>
-sftp://192.168.1.1/+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> </code>
  
 ===== Extras ===== ===== Extras =====
-==== Announce on the network ==== +==== Popular clients ==== 
-You may want to announce the service on the network using Bonjour/Zeroconf so that Cyberduck and similar clients finds it.+  * 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> <code bash>
-# Install packages 
 opkg update opkg update
 opkg install announce opkg install announce
 </code> </code>
  
-==== OpenSSH compatibility ==== +See also [[docs:guide-developer:mdns|umdns Multicast DNS Daemon]]
-Dropbear does not support SFTP by itself. +
-Meanwhile OpenSSH client uses SFTP [[https://www.openssh.com/releasenotes.html#9.0|by default]]. +
-Use ''scp -O'' for the [[https://man.openbsd.org/scp#O|legacy SCP protocol]] if necwssary.+
  • Last modified: 2023/10/14 05:25
  • by vgaetera