Amir Zadeh
Amir Zadeh

Reputation: 3629

Deny access to a specific folder for a sudo user

I have a question: I am root in an Ubuntu system. I want to give a user (say username is X) permission to execute any command but at the same time I have a folder that I want no one to be able to access except my user (which is certainly not X because it is say Admin) or root. Any suggestions? Thanks!

Upvotes: 0

Views: 2152

Answers (1)

hek2mgl
hek2mgl

Reputation: 158150

If a user can execute any commands as sudo he can also become root whenever he wants. That's why there is not a chance to protect a directory from browsing by such a user unless you restrict the list of commands the user can execute with sudo.

One idea could be to put the folder on a separate partition which is encrypted with a password. The user would need to decrypt the partition before he could mount that folder.

Upvotes: 3

Related Questions