I have a new (factory default) WD My Book Live (3rd edition) with new firmware "MyBookLive 02.11.09-053 : Core F/W".
I created a user "stephen" via the UI and enabled ssh via the UI. I sshed in as root and edited the file:
/etc/ssh/sshd_config
to add the new user to the "AllowUsers" line:
AllowUsers root stephen
The new user can now ssh in normally.
I created a folder "stephen" via the UI and gave the user write permission via the UI. Sshing in as the user I see:
stephen@MyBookLive:~$ ls -l
total 128
drwxrwxr-x 6 root share 65536 Apr 30 13:16 Public
drwxrwxrw- 2 stephen share 65536 Apr 30 15:02 stephen
The user can cd into this folder and is able to read, write and delete to files:
stephen@MyBookLive:~$ cd stephen
stephen@MyBookLive:~/stephen$ ls -l
total 0
stephen@MyBookLive:~/stephen$ touch test.txt
stephen@MyBookLive:~/stephen$ ls -l
total 0
-rw-rw-rw- 1 stephen share 0 Apr 30 15:07 test.txt
stephen@MyBookLive:~/stephen$ rm test.txt
stephen@MyBookLive:~/stephen$ ls -l
total 0
As the user I can chmod 777 test.txt:
stephen@MyBookLive:~/stephen$ chmod 777 test.txt
stephen@MyBookLive:~/stephen$ ls -l
total 0
-rwxrwxrwx 1 stephen share 0 Apr 30 15:08 test.txt
However, if I try to append to the existing file I receive an error:
stephen@MyBookLive:~/stephen$ ls -l
total 0
-rwxrwxrwx 1 stephen share 0 Apr 30 15:08 test.txt
stephen@MyBookLive:~/stephen$ echo "hi" >> test.txt
-sh: test.txt: Permission denied
This is not the case if I just create a file:
stephen@MyBookLive:~/stephen$ echo "hi" > test.txt
stephen@MyBookLive:~/stephen$ cat test.txt
hi
The root user is able to append to the file as I would expect but not the new user, despite seemingly having the right permissions. I have also tried creating a folder using mkdir (rather than the UI), checking for file locks using smbstatus and even just stopping SAMBA, none of this fixed the problem.
Does anybody have any idea why I would have rwx access to a file but be unable to modify it?
Thanks.