LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-09-2009, 11:44 AM   #1
geek.ksa
Member
 
Registered: Jan 2009
Location: Dhahran, Saudi Arabia
Distribution: RHEL 5
Posts: 42

Rep: Reputation: 17
restrict a user from viewing others dirs except her own


Dear all,

how can i restrict a user from viewing others dirs except her own home dir after login?

I don't want a user to cd outside her own home directory.

thanks
 
Old 07-09-2009, 01:03 PM   #2
beiller
LQ Newbie
 
Registered: Nov 2008
Posts: 22

Rep: Reputation: 15
Well usually you can set up a "chroot" which can jail users to a certain directory, but this is not recommended as it can be easily broken.

The easiest way to do what you want is just to create a user, and set up the files you DONT want them to access by running a command "chmod go-rwx *" (removes file's group, and other users from read, write, and execute permissions". System files are already generally secure from a random user messing with them (everything in /etc/ for example). SO really you want to apply that to other users' home directories. One example how :

cd /home/
chmod go-rwx bill/* -R

this will change the bill directory recursively (everything underneath bill)
 
Old 07-11-2009, 07:19 AM   #3
stureedy
Member
 
Registered: Jul 2009
Location: Lexington, Kentucky, USA
Distribution: Slackware
Posts: 45
Blog Entries: 4

Rep: Reputation: 2
Greetings,

You might try setting the user's shell to rbash. For more information, try: man bash

Hope that helps!
Stu...
 
Old 07-13-2009, 08:56 AM   #4
thedoobie
LQ Newbie
 
Registered: Jul 2009
Distribution: Ubuntu
Posts: 5

Rep: Reputation: 0
I just run
Code:
sudo chmod 0700 /home/*
which restricts users from reading, writing, and executing anything within those directories. It is not really necessary to do this recursively.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
proftpd allow user to access different home dirs skylimit123 Linux - Software 1 11-26-2008 03:59 AM
Apache2 + LDAP Based user dirs tpe Linux - Server 0 11-21-2008 08:28 AM
User has no right to modify ZFS dirs? kebabbert Solaris / OpenSolaris 2 07-04-2007 01:54 PM
Normal user losing all rights on /tmp-dirs ppr:kut Slackware 8 08-29-2006 07:24 AM
Apache access forbidden to user dirs. Spudley SUSE / openSUSE 1 12-29-2005 01:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration