If you tried to copy file securely (i.e. through the
scp command) from or to a Synology NAS drive, you might have been welcomed by the following error message:
1 sh: scp: not found
Well, at least, I did. The message didn’t provide me with much indication about where the issue was coming from, but since
scp was installed locally on my computer, this meant that it probably came from the remote host, the Synology drive.
By default, SCP is indeed not installed on Synology NAS drives. Fortunately, we can solve this quite rapidly but since there are a few manipulations to do, I’ll sum them up below.
First off, I assume that ipkg is installed (this is the case if you followed the article Install GMVault on a Synology Nas). If this is not the case, you can quickly do it by following the instructions on the Synology forum.
As you can guess, many have done the installation before, so there is plenty of documentation available on Synology forums. However, a lot of the articles popping up on Google are related to previous versions of DSM. With DSM 4.1 the installation has been simplified, so we’ll take advantage of that.
Note: It might even be easier to activate it through STFP but I haven’t tried it as I do not want any FTP activated at this stage on the NAS.
Enough talking, let’s get started. To start with, connect to the Synology NAS through SSH and run the following commands:
1 2 3 4 5 6 cd /volume1/@tmp/ ipkg download openssh tar -xvzf openssh_5.9p1-1_arm.ipk tar -xvzf data.tar.gz cp /volume1/@tmp/opt/bin/openssh-scp /bin/scp rm -rf opt/ data.tar.gz openssh_5.9p1-1_arm.ipk control.tar.gz debian-binary
Commands are pretty self-explanatory and result in
scp being copied to the
/bin directory. This could be enough for it to work but in my case, I still received an error message:
1 scp: error while loading shared libraries: libcrypto.so.0.9.8: cannot open shared object file: No such file or directory
This can be solved by creating a symlink:
1 2 cd /usr/lib ln -s libcrypto.so.1.0.0 libcrypto.so.0.9.8
If you still receive an error message, this can be due to missing zlib:
1 ipkg install zlib
And that should be it. SCP is now up and running.