Results 1 to 6 of 6
Hi
I have created a new user say abc. His dome directtory is /home/abc. I need to restrict this user from accessing any directories other than one inside /home/abc. He ...
- 05-10-2007 #1Just Joined!
- Join Date
- May 2007
- Posts
- 2
Permissions
Hi
I have created a new user say abc. His dome directtory is /home/abc. I need to restrict this user from accessing any directories other than one inside /home/abc. He should be able to view, edit, delete, write all the files and directories inside /home/abc. But he should not be able to list, or access any files or directories outside /home/abc. How can I achive this. Please help me.
Thanks
Albin
- 05-10-2007 #2
First you need to create a group for the user. Users are members of a default group. Red Hat Linux will add new users to a group of the same group name as the user name. The default group is specified in the file /etc/passwd
user-name::user-number:group-number:comment section:/home-directory:default-shell
user1::500:500:Greg:/home/user1:/bin/bash
The user id has a user system number associated with it and this is defined in /etc/passwd. The group has a group system number associated with it and this is defined in /etc/group
group-name::group-number:user1,user2
Group Commands:
* gpasswd: administer the /etc/group file
* groupadd: Create a new group
* groupmod: Modify a group
* groupdel: Delete a new group
If using NIS, view the groups using the command: ypcat group
You can then set the permissions for that group by only giving him permissions to his home direcotry by using the chmod command to set his file privlages. Do some googling and you'll probably find a tutorial fairly quickly.$Billz
How much wood would a wood chuck chuck if a wood chuck could chuck wood? None they eat plants!
Dell Optiplex GX260, LTSP Diskless Workstation, Fedora Core 6
- 05-10-2007 #3Just Joined!
- Join Date
- May 2007
- Posts
- 2
Thanks for your reply. Let me do a search on the commands given by you.
BTW, what is NIS?
Thanks
Albin
- 05-10-2007 #4
NIS is Network Information Services. It was formerly known as Sun Yellow Pages (YP), but they just changed the name. Its purpose is to provide information, that has to be known throughout the network, to all machines on the network, such as login names/passwords/home directories (/etc/passwd), group information (/etc/group), host names and IP numbers (/etc/hosts). Some people still run this, thats why I mentioned it.
$Billz
How much wood would a wood chuck chuck if a wood chuck could chuck wood? None they eat plants!
Dell Optiplex GX260, LTSP Diskless Workstation, Fedora Core 6
- 05-10-2007 #5
I'm thinking that you'll have to look up your umask settings too. umask sets default permissions for new files so you'll have to alter these in order to avoid giving all users (world) permission to read new files.
You'll also have to alter the existing files permissions in the other users directories to make sure that the world settings of the permission strings dont grant any access. This is a garbelled way of trying to describe this;
-rwxr-x---
This is roughly what the permission strings of your users files should look like. You can achieve this using the chmod command." I didn't know it was a picture of his wife! I thought it was a publicity shot form Planet Of the Apes."
- 05-10-2007 #6
Frankly, I feel the best way to do this (not necessarily the easiest) would be a chroot jail. To do it the way other people are mentioning, every other user on the system would need to be a member of a special group, that group would need to have permissions to other directories, and the permissions for the one user would need to only allow access to his home. This is VERY inflexible if you want any nuances amongst the other users.
A chroot jail would create a special environment inside your regular environment that you could modify yourself. So /etc, for instance, would be a special /etc that would only contain what you wanted it to. And so on.
For more info, and some utilities, check out:
http://en.wikipedia.org/wiki/ChrootDISTRO=Arch
Registered Linux User #388732


Reply With Quote