This guide shows how to setup Openssh-sftp-server on Synology NAS and connect using sshfs from your Linux Webserver.
It’s a bit of a drag that Synology hasn’t included the OpenSSH Server, but it is not that difficult to do and when it’s done you have secure and easy access to your Synology NAS.
See also how to use Tartarus to backup your Webserver: How to Install and Setup a backup system on Linux Unbuntu 11.04 and Debian based systems using Tartarus
- Install ipkg following the following instructions.
- ipkg update
- ipkg install openssh-sftp-server
- Edit /etc/ssh/sshd_config with the following:
#Subsystem sftp /usr/libexec/sftp-server
Subsystem sftp /volume1/@optware/libexec/sftp-server
- To edit this file use this command: ‘vi /etc/ssh/sshd_config’
- Use pagedown to go to scroll down the file until you see the ‘#override default of no subsystems’ and press Insert on your keyboard to enter edit mode
- After you changed the settings press Escape and then ‘:wq’ to save and exit the file
- Finished, using sftp client software on your PC you will now be able to connect to your NAS by sftp.
This method is NOT recomended for most users. Only use this method if you have a specific reason for needing to do so.
Taken from the official forum. This method describes how to add sftp-server option to an existing DS with only the stock Synology ssh installed. This does not install the openssh package found in the IPKG repository. First of all, you need to get IPKG, read the guidelines inthere and proceed with the below.
Step 1. Getting sftp-server
ipkg download openssh-sftp-server
tar -xvzf openssh-sftp-server_*.ipk
tar -xvzf data.tar.gz
mv ./opt/libexec /usr
Step 2. Getting zlib
ipkg download zlib
tar -xvzf zlib_*.ipk
tar -xvzf data.tar.gz
mv ./opt/lib/libz.so.1.2.5 /lib
ln -s libz.so.1.2.5 libz.so
ln -s libz.so.1.2.5 libz.so.1
Step 3. Cleanup the temp files
When having executed the above, you are able to make sftp connections to your DS.
Step 4. Fix missing libs
If sftp does not work try to start the sftp module on the command line like:
See if this reports any errors, on a DS207+ running firmware DSM 2.2-0942 it would report a libcrypto.so not found like:
Correct this by adding a symbolic link
ln -s libcrypto.so.1.0.0 libcrypto.so.0.9.8
<h3>Step 5. Check sshd_config</h3>
In order for the sftp server to start automatically with boot/ssh daemon, this must be viewed as part of the /etc/ssh/sshd_config
<pre># override default of no subsystems
Subsystem sftp /usr/libexec/sftp-server
Install sshfs on server
This short tutorial describes how partitions can by copied as image to another server with the rescue system,sshfs and partimage.
To mount a foreign directory on a server using ssh, you need to install sshfs in the rescue system and load thefuse module.
apt-get install sshfs
Connect and mount
Now a directory from a remote server can be mounted encrypted.