Score:0

Read only /root folder

ml flag

Can a user have read-only access to the /root folder? For example, only in the .bash_history file.

in flag
If I am understanding your question correctly, and if you are running a recent version of Ubuntu, the answer is *ideally* "No". You can, of course, have an administrator change the access permissions of the `/root` directory to allow others to access it, but it's not a good idea as there are files that expect to be owned and accessible only by `root`.
Yannis avatar
ml flag
You understood my question correctly. I want read-only access to the history file of the root folder. Thanks!
cn flag
No, /root is root's home. A user can not even enter the directory /root. "have an administrator change the access permissions of the /root directory to allow others to access it," I consider that a serious security breach. Users have NOTHING to do on the base system. Only the admin and that one can do "sudo" to get into /root. And an admin can always do more than read.
cn flag
I would do it like this: have the system copy the file using that user as owner to a location where that user can view files every so often (could be x-minutes but also a trigger checkgin for new lines in the file) Altering is possible but it will be overwritten by a new copy action.
user535733 avatar
cn flag
Confused by the question: On a typical multi-user Ubuntu system that is properly administered, there should normally be no `/root/.bash_history` file to view anyway, as the root login account is disabled. There seems more to this story than so far disclosed.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.