Not able to give write permission to other user with ACL or chmod
3
votes
2
answers
1010
views
Anyone know why rocky can't write to
/tmp/afile
? Giving rocky permission as an other user with chmod o+w
doesn't seem to work either 🤔
I updated the acl with: setfacl -m u:rocky:rw /tmp/afile
id as rocky and owner:
> rocky@jammy:~$ id
> uid=1001(rocky) gid=1001(rocky) groups=1001(rocky)
> seb@jammy:~$ id
> uid=1000(seb) gid=1000(seb) groups=1000(seb),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),122(lpadmin),134(lxd),135(sambashare)
ls -ld output
> seb@jammy:~$ ls -ld /tmp/afile
> -rw-rw-rw-+ 1 seb seb 0 Jul 3 14:25 /tmp/afile
Owner is able to write without issue:
> seb@jammy:~$ echo rounders > /tmp/afile
> seb@jammy:~$ cat /tmp/afile
> rounders
getfacl -n output:
> seb@jammy:~$ getfacl -n /tmp/afile getfacl: Removing leading '/' from
> absolute path names
> # file: tmp/afile
> # owner: 1000
> # group: 1000
> user::rw-
> user:1001:rw-
> group::rw-
> mask::rw-
> other::rw-
df -T and mount output:
> seb@jammy:~$ df -T /tmp
> Filesystem Type 1K-blocks Used Available Use% Mounted on
> /dev/sda2 ext4 120044288 18487840 95412296 17% /
> seb@jammy:~$ mount | grep /dev/sda2
> /dev/sda2 on / type ext4 (rw,relatime,errors=remount-ro)
> /dev/sda2 on /var/snap/firefox/common/host-hunspell type ext4 (ro,noexec,noatime,errors=remount-ro)
Attempt to write to file as rocky:
seb@jammy:~$ getfacl /tmp/afile
getfacl: Removing leading '/' from absolute path names
# file: tmp/afile
# owner: seb
# group: seb
user::rw-
user:rocky:rw-
group::rw-
mask::rw-
other::rw-
seb@jammy:~$ su - rocky
#Password:
rocky@jammy:~$ echo hello > /tmp/afile
-bash: /tmp/afile: Permission denied
Asked by Newbie
(33 rep)
Jul 3, 2023, 01:31 PM
Last activity: Jul 3, 2023, 08:14 PM
Last activity: Jul 3, 2023, 08:14 PM