I have created two types of users, one is admin and another is a standard user.

ctrl+H is the shortcut to see hidden files in most of the linux file managers.

I want to disable that option for standard user. When a standard user tries to unhide files then the system won't do anything, just disable the hide and unhide options.

My primary goal is when any standard user press ctrl+H then system not show hidden files to standard user.
Secondary goal is there is no any other option to see hidden files for standard user.
I only concentrate to only revoke from seeing hidden files because making hidden files are easy and time saving as compare to make separate permission for each folder. Managing separate permissions for each folder is time consuming and sophisticated task and Also we need root privilege to manage permission or edit permission, I want to avoid many times calling for Root. Also when managing permission many times we confuse between system files/folder also there is probability to making any silly mistake during manage special permissions as per each folder/file. In simple words I want revoke access of files which names are starting with . dot

  • @sem-geologist my pc use by many users. If i create stander user for it, but stander user can't able to hide hidden files. Also I just want to revoke users to see hidden files. Oct 28 '16 at 9:02
  • 2
    I don't get why you need that, You know that such user can just simply ls -a ? such user anyway can't reach and do anything with other users files (i.e. your files) (or even peek into if the permissions are set right). If such user is keen to destroy his home folder and his configs by messing with hidden files, it is really hard to prevent him from doing it. Oct 28 '16 at 9:08
  • 2
    @MadhavNikam Standard users can hide files, simply by renaming them to start with a dot. They can also see them, by opening a terminal and doing ls -l, or pressing Ctrl-H in nautilus. What precisely is your goal: to hide complexity from standard users, or to prevent them from seeing things they aren't allowed to?
    – zwets
    Oct 28 '16 at 9:12
  • @zwets I want revoke to see hidden files from standerd user, because its time saving as compare to edit permission as per group/user or folder/files. When I make folder with special permission its time consuming and also I confuse sometimes which file/folder is from system. Oct 28 '16 at 9:20
  • 4
    @MadhavNikam please modify your question to make clear exactly what you want to achieve. You could obviously reassign Ctrl-H to "do nothing" but then there is still the menu option View / Hidden files, the command line ls -a, and obviously they can still be opened and read by any user. What sort of files are you trying to hide? What do you want to achieve by hiding them? What is the ultimate goal you want to achieve?
    – zwets
    Oct 28 '16 at 10:05

Your last comment says, you actually wanted to prevent users from seeing all hidden files (those starting with .). This is not possible in Linux and this will never going to help in security.

Because Linux uses .hidden files almost everywhere, even a users shell configuration is stored in hidden files (such as .bashrc, .zshrc etc). If you remove the read permission from it, all users settings will be removed.

Take another example. Firefox uses .mozilla directory for a user in their home. If you remove read permission, firefox will not function normally. You can remove execution bit from the directory, but it won't prevent users seeing the name of the .mozilla directory, though they can't access further.

You might be thinking that the purpose of those .hidden files are security, but it isn't. The main goal of not showing files/dirs starting with . is cleanliness. The thought was a user only need to see those files who s/he uses regularly.

So, the only way to revoke standard users' seeing permission is, using Linux standard permission settings. See these questions

Prevent Ctrl-H from showing hidden files.

If you want to still prevent users from using Ctrl-H, you can apply a trick. Setting a bogus command for that same keyboard shortcut.

To do so in Unity, Go to the System Settings -> Keyboard. In the Shortcut tab, click Custom Shortcut and then the + button. Set anything as the name field and in the command use /bin/bash -c "echo". Click apply.

Then click on the shortcut name at the right end and press Ctrl-H. This will override the shortcut and you can't see hidden files by using shortcut.

Note As I already said, this will not prevent users from seeing hidden files by using menu options or other means.

  • Add more info about how do disable Ctrl+h for standard user if possible Nov 4 '16 at 17:55
  • @MadhavNikam I've updated the answer. That will disable the shortcut but check the note.
    – Anwar
    Nov 4 '16 at 19:05

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.