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”


[root@taco:/]# chmod 0751 /home
[root@taco:/]# 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


[root@taco:/]# chmod 0751 jordan
[root@taco:/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!


Did you like this article?


0 Shares:
You May Also Like

Symantec outgrows underground nuclear bunker

Almost like a RTCW Malware Camp. Would be interesting to see what the bunker looks like.
Symantec outgrows underground nuclear bunker - Symantec has emerged from its bunker in the British countryside, moving its malware-fighting operations from a former U.K. military nuclear shelter to a more conventional office in Reading. The nuclear bunker, with concrete walls and an obscure entrance on a hillside near Twyford, England, was used for one of the company's Special Operations Center (SOC). The regional centers are used by security analysts who are part of the company's Managed Security Services. Companies hire Symantec to help with part or all of their IT security operations.

The nuclear shelter may have been good public relations for a security company, but it wasn't comfortable: It lacked windows and had "sanitation" problems, company officials said. On Wednesday, Symantec offered a tour of its new facility in Reading to journalists, analysts, and customers. The facility, formerly used by storage company Veritas, which Symantec acquired in 2005, has twice as much space as the bunker and was needed to accommodate Symantec's growth.

View: The full story
News source: Infoworld

Read full story...

[NeoWin-Main]
Read More

Creative Zen Stone Plus lobbed at consumers

Creative Zen Stone Plus lobbed at consumers -

Filed under:


It was barely a month ago that Creative pelted the market with its Zen Stone, and now they're rolling out a re-upped and revamped version known as the Zen Stone Plus. While pretty much keeping the form factor the same, Creative has added a blue OLED screen, FM tuner, karaoke mode, and a stopwatch. The capacity has been increased to 2GB, doubling the original Stone's, but the color choices remain the same. Price and release date haven't been mentioned, but you'll know as soon as we do.

[Via epiZENter]

 

Read | Permalink | Email this | Comments


Office Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life!

[EnGadget]
Read More

KDE 4 Beta 3 – Screenshot Tour

A rather in-depth screenshot tour of the new KDE 4 beta 3 booted from a LiveCD.
Stephan Binner has released a new version of his KDE Four Live CD. This version uses a recent SVN snapshot and works quite well. While I had some trouble testing the newest KDE 4 Beta release on my test machine, the KDE Four LiveCD works surprisingly well. According to Stephan the version used on this LiveCD is KDE 4 Beta 3 plus a set of recent patches.
See the full Screenshot tour
Read More