How to Setup SFTP on My Cloud

Continuing the discussion from SFTP Setup:

I just purchased my first My Cloud (4TB), and am upgrading from a My Book Live, in which I had previously setup SFTP.

Unfortunately, I can’t get it to work on the My Cloud. I can find/edit the /etc/ssh/sshd_config file, but can’t restart the SSH daemon. Neither of the following commands work:

sudo service ssh restart

    (returns:  sudo: service: command not found)

/etc/init.d/ssh restart

    (returns:  -sh: /etc/init.d/ssh: not found)

When I look in the /etc/init.d folder, most of the service commands are missing, including sudo and ssh.

Am I missing a step here, from those provided by @Theagustin ? Or do I have a different version of My Cloud? Firmware version is 2.11.133.

I tried rebooting the My Cloud box. The SFTP seems to be there when attempting to login with a client, but doesn’t look like it recognizes the user.

Any suggestions would be appreciated!

Do you have a v2.x My Cloud or a v4.x My Cloud. The firmware version will tell you which My Cloud version you have. If using a v4.x My Cloud the command sudo service ssh restart should work. Here is the results when the command is issued on a v4.x My Cloud:

login as: root
root@192.xxx.x.xx's password:
Linux WDMyCloud 3.2.26 #1 SMP Thu Jul 9 11:14:15 PDT 2015 wd-2.4-rel armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Feb 20 20:48:43 2016 from xxxxxx-xxxxx.xxxx.com
WDMyCloud:~# sudo service ssh restart
[ ok ] Restarting OpenBSD Secure Shell server: sshd.
WDMyCloud:~# cd ..
WDMyCloud:/# sudo service ssh restart
[ ok ] Restarting OpenBSD Secure Shell server: sshd.
WDMyCloud:/#

The firmware version is: 2.11.133.

Am I screwed?

There is probably a different command to restart the SSH service under the v2.x firmware. Maybe use: sudo service sshd restart or /etc/init.d/sshd restart.

No. Same result. “Not found”.

After learning learning about the v2 and v4 firmware series’. I searched for the difference. A little non-intuitive!

So My Cloud (gen1) can run firmware v3.xx.xxx and v4.xx.xxx releases. My Cloud (gen2) runs v2.xx.xx releases.

Apparently gen2, has a stripped-down Linux (thanks WD), explaining why lots of things are missing.

I’m not a Linux pro, but it sounds like the solution (if available) would be some sort of Linux feature package that could be installed on the My Cloud (gen2).

Anybody out there have any experience with such a solution? …or alternative suggestions?

All I want is the SFTP (SSHD), ideally, to keep my “hacking” to a minimum…

Thanks!

Ok! Thanks @Fox_exe!

I’ll take a look!

You can use SFTP just use the root username and password. Then point the SFTP program to use the Shares folder as the default location when it logs in.

Well maybe not “that” minimum. It’s for family access. I want to limit their access, depending on who they are.

Yeah. I think this is beyond me to figure out how to extract/install only what I need out of 290MB, and how to not brick my box while I’m at it.

Thanks anyway, though!

Any other ideas out there?

It should be noted that even if you use the method of editing the sshd_config file to add the user name to the the AllowUsers entry, that User would apparently still have full access to the drive where they could potentially “hack” it. It would possibly require more configuration to prevent the user from having full access to the root directory. At least with FTP (as insecure as it is) the user would be confined to accessing just those Shares they are permitted to access via the Desktop and would not have access to the root directory of the My Cloud.

kill -HUP `cat /var/run/sshd.pid`

will force a restart. Though, I noticed that any configuration changes to sshd_config, /etc folder, /etc/passwd seems to get reset anytime device gets booted (at least for me).

Hello Guys… Can anyone tell me if i can use ‘‘FreeFileSync’’ to access my cloud over outsider my network through internet?
If so, can anyone tell me what would be the server name to use on the App?
I want to setup my laptop with any sync app that is more user friendly than the WD Sync app, with My Cloud, but i will have normally my laptop on my office and I have the ‘‘My Cloud’’ at my house…
I already tried several things, but without success…
Also, i will need to use Proxycap to config the proxy so that i can have free connection for the app on my office…
Any help that you can give me i will really appreciate…
Thanks a lot guys…

Yes you could potentially use Free File Sync to sync to the My Cloud remotely using SFTP. See the following link: http://www.freefilesync.org/manual.php?topic=synchronize-with-sftp

Once you have the My Cloud configured for SFTP you would need to enable port forwarding within your network router/gateway to pass the SFTP port from the broadband connection to the My Cloud.

You would use the broadband IP address as the “Server name or IP address” on the Free File Sync SFTP dialog screen.