Connect to Synology NAS via SSH

I purchased the Advanced FTP add-on in the hope of being able to login to my Synology NAS with SSH (DS218). I am logging in with the root account, both Putty and WinSCP connect fine but Dopus outputs the following log error:

Opened main channel
Started a shell/command
Server sent command exit status 255
SSH: Fatal: Received unexpected end-of-file from SFTP server
Connection closed

Not sure what the problem is and if it's a simple setting issue or Dopus simply cannot connect using this method. If Putty can connect, should Dopus be able to?

Are you definitely using SFTP with WinSCP? It may be using SCP, which is a different protocol. (WinSCP can use both.)

When you say Putty works, do you mean Putty itself as an interactive shell, or Putty's standalone file transfer program?

Please try using FileZilla in SFTP mode to see if that has the same problem.

There are a lot of things on the Synology which can cause SFTP to fail. This thread lists several problems and solutions, which might apply:

https://forum.synology.com/enu/viewtopic.php?t=122940

I was trying with the standalone Putty "SSH and Telenet" client. That works OK

I also tried with the OpenSSH built into Windows 10, that works as well.

You are right, I was using SCP in WinSCP, using SFTP fails in that and anything else.

I guess it was throwing me a touch because the Dopus FTP logs mention OpenSSH and Putty and I thought it was going to work like they do. :wink:

When Synology updated DiskStation Manager to v6 they changed a ton of stuff, some of which probably affects logging in via SFTP. I'm a bit wary of trying fixes for older DSM versions as so much changed. Problem is most offered solutions to this problem are just to use SCP but obviously that's not possible here.

Maybe other Dopus users out there have got Dopus SFTP > Synology root working...?

If Synology have broken the SFTP functionality in an update, you should ask them for a fix. Their devices cost a lot of money so I would expect them to have good support as part of the deal.

I wouldn't say the update broke it, they made several changes from v5 > v6 to increase security and there may be additional steps or changes needed to get things working. A bit like going from Win 7 > Win 10, you'd be wary of changing system settings in Win 10 after reading an old Win 7 post on the internet.

Looks like there could be a setting problem somewhere with SFTP because OpenSSH in Win 10, Putty and SCP work, including the Total Commander SFTP/SCP plugin!

Or maybe I'll have to wait for the day when Opus supports SCP.… :wink:

Did you try the admin account. On DSM the root account is restricted and by default you wont be able to login using it.
I think to use root, you need to first SSH in as admin and give the root account a password. You also need to allow root FTP access. But I'm not sure if that still works in the latest DMS.
I have a Synology and can use Dopus SFTP with the admin account. I have both SSH and FTP enabled in the control panel.

Yes, the admin account works but obviously you don't get root access. Root access is possible with SSH/SCP and the admin account if you enter the Sudo -i command and re-enter your password.

I have enabled the root account and can access it easily using root directly or the admin method with SCP and SSH tools like Putty, the Windows 10 OpenSSH addon, WinSCP and Total Commander. It's not general access I'm after but ideally root access with the Opus SFTP via SSH method.

Maybe SFTP over SSH in this way is simply not possible, it would be interesting to know if other Opus users have got it working or know it can't currently be done.

There are people in the thread I linked who have got it working again on newer versions of Synology's setup. It's definitely possible, they just seem to break it by default. (Not sure why as you can do a lot more damage with a full SSH login than the more limited SFTP, so it probably isn't for security reasons.)

The link you posted is to get SSH to work, SSH itself is working which is why I can successfully use Putty/OpenSSH etc. It's SFTP that doesn't work for root access. As you know, SSH and SFTP are different things. It's the difference between the two that appears to be causing the problem.

@Roycom, where you able to find a solution?

Please, how did you do that (in bold)?

Thanks