Skip to content Skip to sidebar Skip to footer

Ubuntu Pbis Open Prevent Users From Reading Others Home Directories

If you share your Ubuntu machine with other people, you probably accept multiple users ready, thinking that the other users log into their ain accounts and only have admission to their own home directories. However, past default, any user tin admission any home directory.

RELATED: How Practise Linux File Permissions Work?

When you lot add a new user in Ubuntu, the adduser utility creates a new habitation directory for the new account. By default, the new home directory is placed in the /home/ directory on the root followed by the username. For example, /dwelling/lori. User home directories in Ubuntu are created with world read/execute permissions, giving all other users on the system rights to read the contents of other users' dwelling house directories. See our article for more data about how file permissions work in Linux.

Notation: When we say to type something in this article and there are quotes around the text, Practice NOT type the quotes, unless we specify otherwise.

You tin easily change the permissions for your home directory to protect your private files. To cheque the permissions on your home directory, printing Ctrl+Alt+T to open up a Terminal window. Type the following line at the prompt and press Enter. Supersede "lori" with your own username.

ls –ld /home/lori

NOTE: The command contains only lowercase Fifty's not the number 1.

At the beginning of the line, the permissions for the file are listed. Every bit said in our article about Linux permissions:

"The r stands for "read," the w stands for "write," and the ten stands for "execute." Directories will start with a "d" instead of a "-". Y'all'll also notice that in that location are 10 spaces which hold value. You lot tin can ignore the commencement, and and then there are three sets of 3. The start set is for the owner, the 2d set up is for the grouping, and the concluding set is for the world."

So, the home directory listed beneath has read, write, and execute permissions for the owner and read and execute permission for the grouping and globe.

To change these permissions, blazon the following line at the prompt and press Enter.

sudo chmod 0750 /dwelling house/lori

Blazon your password when prompted and printing Enter.

NOTE: The chmod command uses octal numbers as one way to indicate permissions. Our commodity almost Linux file permissions uses a dissimilar method that requires more steps merely may be easier to understand. Using the octal numbers to specify permissions is a quicker method. Use whichever method with which you are more comfortable. To learn nigh using octal numbers to set permissions, see this article.

RELATED: The Beginner's Guide to Managing Users and Groups in Linux

Press the up arrow twice to employ the "ls –ld /abode/<username>" command once more to check the permissions. Observe that the permissions for world are all dashes (-). That means that the world cannot read, write, or execute anything in your home directory.

However, users in the same group equally you tin read and execute files and folders in your home directory. If you lot don't want anyone else but yourself to have access to your dwelling house directory, enter "0700" equally the numbers in the chmod command.

Note: For more than information about managing users and groups in Linux, run across our article.

To close the final window, type "go out" at the prompt and press Enter.

At present, when other users on the system try to access your home directory, the post-obit dialog box displays.

You can also prepare Ubuntu to use specific permissions when setting up the domicile directory for a new user you are creating. To do this, you demand to edit the adduser configuration file. To practice this, type the post-obit command at the prompt and printing Enter.

gksudo gedit /etc/adduser.conf

Nosotros are using gedit to edit the file. You tin can use a different text editor if you want.

Notation: The gksudo command is like the sudo command but is used to run graphical programs as root. The sudo control is used to run control line programs equally root.

Enter your password in the Password edit box on the dialog box that displays and press Enter or click OK.

Ringlet down to the DIR_MODE command in the adduser.conf file. The number set is "0755" by default. Alter it to reflect the  unlike types of permissions (r, w, x) you desire to grant to the different types of users (owner, grouping, world), such as "0750" or "0700" as discussed earlier. Click Salvage.

Shut gedit by selecting Quit from the File carte du jour. You can also click the X button in the upper-left corner of the window to shut gedit.

Close the Terminal window past clicking the X in the upper-left corner of the window.

Now, the files in your home directory will remain individual. Simply remember that, if there are other users in the same group as you, you might want to take away the permissions for both group and earth for your abode directory.

dingersarronever.blogspot.com

Source: https://www.howtogeek.com/190084/how-to-prevent-other-users-from-accessing-your-home-directory-in-ubuntu-14.04/

ارسال یک نظر for "Ubuntu Pbis Open Prevent Users From Reading Others Home Directories"