How to disable hard link to /etc/passwd

1k Views Asked by At

I am learning security recently, and noticed that on my experiment system I can create a hard link to /etc/passwd in my home directory, while on my work system I cannot:

$ ln /etc/passwd ln: failed to create hard link ./passwd' =>/etc/passwd': Operation not permitted

What is done to disable this?

1

There are 1 best solutions below

1
On

This is because you are trying to create hardlink to /etc/passwd on a different volume. Most likely at your home system you setup everything onto a single volume.