I am only able to access my MyCloud 2nd Gen as a root. How can I enable SSH access for my users?
Obviously there is no official way to do that. However, I’ve seen related posts that suggest adding a user name to /etc/ssh/sshd_config (into the AllowUsers). However, this does not seem to work in my case. After restart, I get “ssh: Permission denied, please try again.”
My user was created from the web interface. I am not able to add new users via shell (useradd is not found).
I suspect my firmware version (2.21.119) is less permissive to allow user SSH access. Or am I missing something?
Its been reported in other threads that when a gen 2 My Cloud (v2.x) is restarted/rebooted it resets or replaces various firmware files which is why its harder to mod the gen 2 My Clouds. This would be the cause of why your changes are not working after restarting the MY Cloud.
Did you manage to succeed? I am trying the same thing. I can ssh into with non root user, but I can not make it work for ssh keys for non root, only for root.
Also, are you using something like fun_plug to restore the /etc/passwd file and friends?
(During main init, the startup script looks on the first mounted USB disk for a file called “fun_plug”, then executes it after all the user daemons have started. You can use this to restore various important system files from the internal storage, then restart daemons as needed.)
Remember, opensshd uses “per-user” ssh keys. Root has a keypair that is stored on the persistent configuration partition (bound to the root file system with a symbolic link), but any other users you create do not. OpenSSHd uses files located in the appropriate user’s home directories to store these keys. Since the root file system is backed by a ramdisk, and these users get wiped out on every reboot, your fun_plug needs to restore the necesary folders and permissions, and populate them with the correct key files, before you restart sshd.
Under each user’s home folder, there will be a folder called /.ssh inside of which will be several files. These are all necessary for individual user accounts to accept or refuse key pairs at logon. These need to be preserved somehow.
The easiest way to do this is to create the needed user folders under /home, then link them to persistent folders with ln -s, and have that happen in your fun_plug user script after restoring /etc/passwd and pals.