Home IT Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ How do you prevent other users from accessing your home directory in Linux     - Ubuntu15 core CLR (Server)

- Java Access Control (Programming)

- Thrift 0.9.3 compiler installation under Ubuntu (Linux)

- xCAT line installation on CentOS 6.X (Linux)

- C ++ Supplements - Virtual Function Principle (Programming)

- Oracle Database ORA-01555 snapshot too old (Database)

- How to use Monit to deploy a server to monitor the system (Server)

- Getting Started with Linux system to learn: how to install the Shrew Soft IPsec VPN on Linux (Linux)

- Linux-based Heartbeat high availability configuration httpd service (Server)

- How to create a someone project on github (Linux)

- C # C ++ Java interface type conversion (Programming)

- Introduction Linux namespace (Linux)

- Expand an existing RAID arrays and remove the failed disk in a RAID (Linux)

- Linux process management related content (Linux)

- CentOS 6.4 under PXE + Kickstart unattended operating system installation (Programming)

- Linux operating process information (Linux)

- Ubuntu Gnome and Fedora 22 Gnome desktop, extended to achieve global menu (Linux)

- Why not use the ifconfig command under RedHat Linux 5 (Linux)

- Ubuntu users install the video driver Nvidia Driver 334.21 (Linux)

- Linux system security knowledge (Linux)

  How do you prevent other users from accessing your home directory in Linux
  Add Date : 2018-11-21      
  If you and others share Ubuntu machine, then you may want to set up multiple users, want other users to log on to their account and can only access their own home directory. However, by default, any user can access any one of the home directory.

When you add a new user in Ubuntu, adduser tools for the new account added to a new home directory. By default, the root directory is located below / home / directory, and the name of the account user name. For example, / home / lori. The user's home directory created Ubuntu have other people read / execute permissions, which gives the system all other users can read a number of additional rights outside the user's home directory content. For details, please read our article file permissions in Linux is how it works.

NOTE: When we enter what is mentioned in the text, enter the text in quotation marks, do not enter the quotes, unless we specify otherwise.

You can easily modify your home directory permissions to protect your private files. To check the permissions of your home directory, enter Ctrl + Alt + T to open a terminal window and enter the following command at the prompt, then press Enter. Use your own user name to replace the following "user name."

ls -ld / home / lori
Note: This command contains only lowercase L, not the number 1. (LCTT Annotation: This is totally white to suggest that the vast majority of people can ignore the remarks)

In the beginning of the line that lists the permissions on the file. As we in the article about the Linux permission to speak as part of.

r indicates "read", w stands for "write" and x means "execute." Directory permissions to "d" at the beginning, instead of "-." You will also notice the permissions value accounted for 10 positions. You can ignore the first, followed by a group of three, divided into three groups. The first group is the owner (owner) permission, the second group is a group (group) permissions, and the last group of other people (other or the world) permission.

Thus, the owner of the home directory listed below has read, write, and execute permissions, and belongs to the group and others have read and execute permissions.

To modify these permissions, enter the following line at the prompt and press Enter

sudo chmod 0750 / home / lori
When you are prompted for a password, enter and press Enter.

Note: chmod command uses octal numbers as a way to assign permissions. We are talking about Linux use rights article a different method, which takes a few steps, but may be easier to understand. Octal numbers to specify the permissions, is a faster way. Regardless of the method, as long as you like with a comfortable.

Press the up arrow twice, called again "ls -ld / home / username" command to check the permissions. Note that other people permission are now dash (-), which means that other people can not read, write or execute your home directory anything.

However, with your user and group can read and execute your home directory files and folders. If you do not want anyone except you access your home directory, you can enter "0700" in the chmod command.

NOTE: For more information about the Linux user and group management, please see our article

To close the terminal window, at the prompt enter "exit" and press Enter.

Now, when their systems of other users trying to access your home directory, the following dialog box will pop up.

You may even make Ubuntu use permissions specified when creating a new user. To accomplish this task, you need to edit the configuration file adduser. To edit the file, enter the following command at the prompt and press Enter.

gksudo gedit /etc/adduser.conf
We use gedit to edit the file, you can also use other text editor you want.

NOTE: gksudo command sudo command and seemingly the same, but it is used as root to run graphical applications, and sudo command to run as root command-line program.

In the pop-up dialog box, enter the password to edit your password and press Enter or click OK (OK).

Scroll down to the file in adduser.conf DIR_MODE command prompt, where the default value is "0755." Modify the value to reflect you want to empower the various types of users (owner, is a group, others) of different permissions (r, w, x), as we discussed earlier, "0750" or "0700." Click Save (Save).

(File) menu, choose Exit (Quit) to close gedit from gedit file, you can also click on the top left corner of the X button to close it.

Click on the top left corner of the X to close the terminal window.

Now, your home directory files will remain private. Remember, if you and another user in the same group, you might want for your home directory permissions and the general public excluding group privileges.
- Precautions against hackers Linux environment (Linux)
- Locale files under Ubuntu (Linux)
- Linux Thread Synchronization (Programming)
- How to prevent page five invisible killer (Linux)
- System Safety: Windows and Linux platforms (Linux)
- Installation Mesos + Marathon + Zookeeper under CentOS 7 (Server)
- How to install Go1.5 source development environment on Mac (Server)
- How to install GIMP 2.8.16 in Ubuntu 16.04,15.10,14.04 (Linux)
- What happens after the MySQL disk space is full (Database)
- Linux 0.12 kernel and modern kernels difference in memory management (Linux)
- HBase Application Development Review and Summary of Series (Database)
- Use Android Studio and Gradle packaged multi-version APK (Programming)
- Linux itself disguised illusion strengthen security (Linux)
- Kernel compile under Debian (Linux)
- Linux file permissions to modify the command: chmod (Linux)
- Oracle to create an external table (Database)
- Oracle and MySQL difference between the jdbc (Database)
- A list of the basics of Python, Ganso, Dictionary (Programming)
- CMake Quick Start Tutorial (Linux)
- Linux kernel netpoll framework netconsole (Linux)
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.