I am using Kali as root user. I did setup an atftp server in a folder (created and owned by root) and gave 666 permission on that folder. But I noticed users get permission denied error while uploading into atftp. Same was happening with FTP server. So to perform some tests, I created a temporary directory, assigned it 666 permission, tried to create a file using unpriviledged user and I got 'Permission denied'. Then I changed the permission to 777 and repeated the same process. This time file got created.
Case 1: 666 permission
root@kali:~/temp# chmod 666 .
root@kali:~/temp# ls -la
total 8
drw-rw-rw- 2 root root 4096 May 7 00:32 .
drwxr-xr-x 21 root root 4096 May 7 00:32 ..
root@kali:~/temp# su temp
$ touch a
touch: cannot touch 'a': Permission denied
Case 2: 777 permission
root@kali:~/temp# chmod 777 .
root@kali:~/temp# ls -la
total 8
drwxrwxrwx 2 root root 4096 May 7 00:32 .
drwxr-xr-x 21 root root 4096 May 7 00:32 ..
root@kali:~/temp# su temp
$ touch a
$ ls -la
total 8
drwxrwxrwx 2 root root 4096 May 7 00:32 .
drwxr-xr-x 21 root root 4096 May 7 00:32 ..
-rw-r--r-- 1 temp temp 0 May 7 00:32 a
$
How come adding additional x
permission is helping with writing files even when folder had w
in both cases?