Linux@lemmy.mlbySandal6823@sh.itjust.works11 monthsWhy disable ssh login with root on a server if I only log in with keys, not password? On a server I have a public key auth only for root account. Is there any point of logging in with a different account? 7899104
On a server I have a public key auth only for root account. Is there any point of logging in with a different account?
SavvyWolf@pawb.socialEnglish11 monthsI don’t think that actually works; the attacker could just remove .bashrc and create a new file with the same name. 050%1
2ndSkin@sh.itjust.works11 monthsIf the .bashrc is immutable, the attacker can’t remove it. That’s how it works. 475%6
SavvyWolf@pawb.socialEnglish11 monthsThe home directory would need to be immutable, not bashrc. 050%2
2ndSkin@sh.itjust.works11 months? It’s .bashrc, not bashrc, and .bashrc is in the home directory. If .bashrc is immutable, it can’t be removed from home. 4
SavvyWolf@pawb.socialEnglish11 monthsIt’s the directory that needs to be writable to delete files, not the file itself. Although the immutable bit (if that’s what you’re talking about - I thought you meant unsetting the write bit) might change that, I’m not sure. 1
WheelchairArtist@lemmy.worldBanned11 monthsyou’re right. that’s something i wanted to look into. guess setfacl would do the trick? 167%2
that’s why root owns my .bash* stuff
I don’t think that actually works; the attacker could just remove .bashrc and create a new file with the same name.
If the .bashrc is immutable, the attacker can’t remove it.
That’s how it works.
The home directory would need to be immutable, not bashrc.
?
It’s .bashrc, not bashrc, and .bashrc is in the home directory.
If .bashrc is immutable, it can’t be removed from home.
It’s the directory that needs to be writable to delete files, not the file itself.
Although the immutable bit (if that’s what you’re talking about - I thought you meant unsetting the write bit) might change that, I’m not sure.
you’re right. that’s something i wanted to look into. guess setfacl would do the trick?
“chattr +i” is what I use to make things immutable
thanks
deleted by creator