You are not logged in.
I'm looking to improve the security of my install, and I've been going through the recommendations at https://wiki.archlinux.org/title/Security to see which ones make sense for me. The mount options section recommends using the nodev, nosuid and noexec options on a few directories, however I have my entire install one one partition (except the efi). Based on the example to give just Steam the exec option, can I simply add a line after my / mount for the other directories, e.g.
/home /home none defaults,lazytime,nodev,nosuid,noexec 0 2? And say I want to keep exec permissions for a bin dir in home, would I add another line like
/home/myuser/bin /home/myuser/bin none defaults,lazytime,nodev,nosuid 0 2?
Last edited by mMDAm (2023-09-30 19:19:47)
Offline
No.
Well, almost.
Did you try?
You can use bind mounts to mount an existing directory somewhere else and change the mount options on the fly
https://man.archlinux.org/man/mount.8#B … _operation
This can be leveraged to remount a directory into itself and strip the noexec flag
https://unix.stackexchange.com/question … out-noexec
Unlike the 2013 thread suggests, you don't need a script for that, but I'd be surprised if the bind option was simply implied?
/home /home none bind,defaults,lazytime,nodev,nosuid,noexec
/home/myuser/bin /home/myuser/bin none bind,defaults,lazytime,nodev,nosuid,exec(Not sure whether the explicit "exec" is required but it won't hurt)
Offline
I hadn't tried it, but that worked, thanks! I had just missed that extra "bind" option in the wiki. I also added the "user" option for exceptions in my home folder
Offline
\o/
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Offline