How to restrict users in linux to their home directory

So lets say you have a server with a bunch of users and they all have sites and data and you don’t want them to be able to see each others data. A lot of distributions aren’t setup to stop users from wandering and reading files within other users directories.

So lets say you have a server with a bunch of users and they all have sites and data and you don’t want them to be able to see each others data. A lot of distributions aren’t setup to stop users from wandering and reading files within other users directories.

What you will need to do is change the permissions on the /home and each users directory using chmod. So first we need to change the permission on “/home”


[[email protected]:/]# chmod 0751 /home
[[email protected]:/]# stat home
File: `home'
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 900h/2304d Inode: 2 Links: 32
Access: (0751/drwxr-x--x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2007-12-03 13:58:07.000000000 -0800
Modify: 2007-11-21 12:10:17.000000000 -0800
Change: 2007-12-03 13:57:28.000000000 -0800

As you can see the folder is now set to 0751, depending you may want to change this but by default this should be fine.

Now you need to change the permission on each users directory using chmod yet again


[[email protected]:/]# chmod 0751 jordan
[[email protected]:/home]# stat jordan
File: `jordan'
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 900h/2304d Inode: 19709953 Links: 15
Access: (0751/drwxr-x--x) Uid: ( 1000/ jordan) Gid: ( 1000/ jordan)
Access: 2007-12-03 12:14:23.000000000 -0800
Modify: 2007-11-14 11:06:38.000000000 -0800
Change: 2007-12-03 13:57:42.000000000 -0800

Now your users shouldn’t be able to see other users on your system!

0 Shares:
You May Also Like

Network Solutions (NSI) is registering every domain name checked throug their WHOIS

I always thought there was something really strange about the WHOIS searches done at Registrars. Specifically the searches would have to be done on their website, a normal "whois" lookup through Linux wouldn't show up registered the next day.
A story is developing regarding domain name registrar Network Solutions front running domains. According to multiple sources on DomainState.com, it appears that domains searched via NSI are being purchased by the registrar thereby preventing a registrant from purchasing it at any other registrar other than NSI. As an example, a random domain which DNN searches such as HowDoesThisDomainTasteTaste.com can be seen in this whois search to now be unavailable to register at other registrars but at NSI it can be purchased
Full article at domainnamenews.com

Windows Live SkyDrive gets 1GB of storage

SkyDrive is an online storage service from Microsoft Windows Live. If you wish to sign up and use the SkyDrive service, you would need a Windows Live account as well as be within the United States to be able to use the service.

Microsoft Pleads With Consumers to Adopt Vista Now

I for one am currently at torn between XP and Vista. I like XP because it doesn't crash, my drivers work. However, more people keep asking for help with Vista, and I haven't even logged into a Vista Machine yet. :(
Microsoft Pleads With Consumers to Adopt Vista Now - SlinkySausage writes "Microsoft has admitted, in an email to the press, that 'some customers may be waiting to adopt Windows Vista because they've heard rumors about device or application compatibility issues, or because they think they should wait for a service pack release.' The company is now pleading with customers not to wait until the release of SP1 at the end of the year, launching a 'fact rich' program to try to convince them to 'proceed with confidence'. The announcement coincides with an embarrassing double-backflip: Microsoft had pre-briefed journalists that it was going to allow home users to run Vista basic and premium under virtual machines like VMWare, but it changed its mind at the last minute and pulled the announcement."

Read more of this story at Slashdot.

[Slasdot]

Webroot Spy Sweeper 5.5.1 Build 3354

Webroot Spy Sweeper 5.5.1 Build 3354 - Spy Sweeper safeguards your identity and restores system performance through fast, smart and powerful anti-spyware protection. Spy Sweeper protects against all types of spyware, including system monitors, Trojan horses, and other threats like CoolWebSearch, Look2Me, and more. Spy Sweeper's advanced removal engine deletes the toughest spyware programs - even removing mutated or "rootkit" spies, some of the nastiest next-generation spyware threats - which are specifically designed to avoid detection and removal. This removal technology saves time and effort by eliminating these vicious threats in one sweep - requiring no need for multiple reboots. As soon as it's installed, Spy Sweeper with AntiVirus offers 360 degrees of protection against spyware and viruses and is now compatible with Windows Vista.

Product features include:

* Detect and disinfect viruses, spyware, Trojans and worms at the point of infection to keep your PC safe
* Your PC can be completely cleaned and disinfected in just a couple of mouse clicks - it's that easy.
* Protect your PC and your Internet activities without any cumbersome configuration using Spy Sweeper with AntiVirus software.

Read full story...

[NeoWin-Software]