How to change file permission in Linux so that only root user can access/open the file/dir in Linux.
chmod 600 filename + sudo chown root:root filename
changes it into only root accessible file. But I can see the file content only when I do $ sudo cat file.txt; but when I just click on it, it says file content can't be displayed. So, when I click on it, I want it to show me a dialog box or something, which prompts me to enter root password and then I can open the file. Is this possible ??
How do I change file permission back from root user to normal user A ?
I can even do
sudo nautilus .and then supply root password to open file. But this is all from terminal. I want to open some kind of application/dialog box so that when I click that file/dir as normal user, it will prompt me to enter root password and not just tell me that you dont have proper file permission to open the file. I guess this must be possible, may be with some scripts. Any idea ?