Hi, I’ve been able to get passwordless SSH access for root by following the info here http://community.wd.com/t5/WD-My-Cloud/ssh-no-password/td-p/650367/page/2 but I have users other than root that can log into the system (one user per mac in the house and each laptop does an rsync to the my cloud for backups). I can’t get the passwordless access to work for users other than root. I’ve tried putting the .ssh in /shares/.ssh/authorized_keys and in /etc/ssh//authorized_keys with a 700 and 640 for .ssh and authorized_keys respectively.
New users are created by default with the same home /shares. You have two option:
Turn off the strictmodes in sshd_config. This will compromise the public keys as they are being shared.
Separate each user home to eg /shares/user (hint, use usermod or edit passwd file). Place both .ssh/authorised_keys in it with the correct permissions (chmod and chown).
Nazar78 wrote:
New users are created by default with the same home /shares. You have two option:
Turn off the strictmodes in sshd_config. This will compromise the public keys as they are being shared.
Separate each user home to eg /shares/user (hint, use usermod or edit passwd file). Place both .ssh/authorised_keys in it with the correct permissions (chmod and chown).
Hi Nazar78, thanks for the reply!! It worked great!!
I like option two. For others that need the same thing. Here’s what I did to set up a user ‘savio’
logged into mycloud as root and copied /etc/passwd to /etc/passwd-safe-in-case-we-screw-up
logged into mycloud as root and went to /etc/passwd and changed /shares: to /shares/savio: as this changes the home directory for user savio to /shares/savio vs. /shares
logged into mycloud as savio and created a .ssh folder under /shares/savio (ie. mkdir /shares/savio/.ssh )
logged into mycloud as savio and created the authorized_keys file (i.e. touch /shares/savio/authorized_keys)
logged into mycloud as savio and run these 3 commands:
chmod 777 /shares/savio
I can’t recall but I believe before these steps, to even allow other users to ssh in WDMyCloud, we first need to modify the file ‘/etc/ssh/sshd_config’ to comment out ‘AllowUsers root’ then restart sshd.
Related to your step 1 & 2, I’ve posted few fixes not long ago about some bugs in firmware v3 which WD didn’t even fix in v4! In the fix, I included an optional patch to easily create user with its home path via WD’s webUI.
Thanks a lot for this help, Nazar – I tried out option one, since there is only one user with ssh priveligies on my WD machine, and it worked like a charm. But could you say a little more about why it does not work to start with. Like the OP I put the public key in /shares/.ssh/authorized_keys with the right acess. The explanation I have read is:
“The option StrictModes specifies whether ssh should check user’s permissions in their home directory and rhosts files before accepting login. This option must always be set to yes because sometimes users may accidentally leave their directory or files world-writable.”
So is it the case that ‘/shares’ is not readable only for me which is the cause of it not working on strictmode? I did set the /shares/.ssh/ and /shares/.ssh/authorized_keys on 700 and 600, respectively.
In any case, thanks a bunch for solving the problem!
Hi SavioR. Thanks for your help
I found your post and followed instructions to give SSH access for a non root user using ssh keys. After several tries it didn’t work
Ssh root access is working fine with key files.
I changed home directory in /etc/passwd file for user and set chmod for directory and files exactly as you wrote.
I think maybe owner and group are not fine.
For example, I created a new user directly from shell and it works perfectly with key files.