Sample Header Ad - 728x90

chown cannot dereference, Permission denied

2 votes
1 answer
649 views
Given,
touch /tmp/abc
ln -vs abc /tmp/def

$ ls -l /tmp/???
-rw-rw-r-- 1 ubuntu ubuntu 0 Apr 10 22:10 /tmp/abc
lrwxrwxrwx 1 ubuntu ubuntu 3 Apr 10 22:10 /tmp/def -> abc
Why I'm getting:
$ sudo chown syslog: /tmp/def
chown: cannot dereference '/tmp/def': Permission denied

$ sudo chown --dereference syslog: /tmp/def
chown: cannot dereference '/tmp/def': Permission denied
Ref: \ chown(1) : >--dereference
    > affect the referent of each symbolic link (this is the default), rather than the symbolic link itself
$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.6 LTS Release: 20.04 Codename: focal
Asked by xpt (1858 rep)
Apr 10, 2024, 10:49 PM
Last activity: Apr 12, 2024, 03:50 PM