Restrict a user of Linux to a home directory after logging in

Source: Internet
Author: User

Log in with root, execute chmod o-r/home This command means that no other user has read access to it, but is accessible, and when the LS command is executed, the permission is denied.
For example, you do the above method, and then use AAA user login, when the AAA user exits home, then execute ls/home will not be enough, but AAA users can use CD/HOME/AAA to enter their own directory.
Here is the procedure, first use the root user login, modify the/home permissions
[[Email protected] ~] chmod o-r/Home
Re-use AAA login, AAA login after own host directory
[[Email protected]~]$ cd/home go to home directory
[[email protected]]$ ls view]
LS:: Permission denied prompts no permissions, in fact inside the other user's host directory
[[email protected]] CD AAA enters its own directory again
[[email protected]~]$ ls view]
Aaa.txt Results
In fact, this time is also different worry about AAA users into other user's directory, because, even if he knows the other user's host directory name, but the Linux system, the user's host directory only for the user and root, and other users and families do not have any access rights. This means that even if AAA executes the CD/HOME/BBB, it will be prompted to be rejected.

Restrict a user of Linux to a home directory after logging in

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.