0

Is there anyway to prevent a non-sudo user from seeing specific partition? lets say "/data" partition? I know that i can prevent the user from accessing the directory, but i preffer to hide it from the user.

is there any option like that? Thanks

  • You could hide the folder if you put it below another folder where user no execute rights, but I don't think you can totally hide a partition: e.g. lsblk, mount or df work without root and show the partitions. – pLumo Apr 11 at 12:45
  • partition or filesystem / mount-point? – Jeff Schaller Apr 11 at 12:52
  • Hello, thanks for the quick answer @RoVo. yes im talking about mount or partition ( the one that we can hide , if possible) currently im looking for any solution , my problem is not about where to store the data (partition/mount) but to hide it from non-sudo user – ChinChen Apr 11 at 12:56
  • @JeffSchaller yes im talking about mount or partition ( the one that we can hide , if possible) currently im looking for any solution , my problem is not about where to store the data (partition/mount) but to hide it from non-sudo use – ChinChen Apr 11 at 12:57
  • You might want to investigate mount namespaces. This won't give you the sudo vs non-sudo but it does let you "hide" a mount, making them only available to a particular group of processes. – Philip Couling Apr 11 at 13:30
0

i wanted to achieve that when my support user is connected , he will not be able to see the "secret" partition.

I have achieved that by adding a "Maintenance mode" to the grub menu, from there the server will get loaded with a different run-level , and I've added a script to "umount" the secret partition while this run-level is getting loaded

Thanks for your answers!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.