How to restrict user to a particular directory?


 
Thread Tools Search this Thread
Operating Systems AIX How to restrict user to a particular directory?
# 1  
Old 03-30-2015
How to restrict user to a particular directory?

hi,

I want to restrict some user access to only 1 directory (including all sub-directories/files in it).
can you please explain me, how can we do this?


example;
Code:
Filesystem    GB blocks      Used      Free %Used Mounted on
/dev/hd4           2.61      1.02      1.59   40% /
/dev/hd2           9.45      4.71      4.74   50% /usr
/dev/hd9var        2.42      0.57      1.85   24% /var
/dev/hd3           5.00      0.00      5.00    1% /tmp
/dev/hd1           0.72      0.02      0.70    3% /home
/dev/hd11admin      0.12      0.00      0.12    1% /admin
/proc                 -         -         -    -  /proc
/dev/hd10opt       3.05      0.36      2.69   12% /opt
/dev/newlv1         0.72      0.02      0.70    3% /abc1

If i create a USER (aixuser1) on AIX, they should be able to see everyting along with /abc1.

I want aixuser1 to see only the "/abc1" directory. And they should not access other directories except /tmp & /abc1.
# 2  
Old 03-30-2015
How about chroot?
# 3  
Old 03-30-2015
Per this thread AIX chroot is meant for FTP and SFTP users....
https://www.ibm.com/developerworks/c...0-000014933869

So IBM AIX is different from what I've worked with. Maybe rsh is the AIX answer. I'm not sure. Anyway we need an answer from the AIX guys.
# 4  
Old 03-30-2015
Thanks for your replies Corona688 & Jim.

manual page for chroot says "The chroot command can be used only by a user operating with root user authority"

In my case, i am not providing root authority to user "aixuser1". this is normal user.

Code:
id aixuser1
uid=205(aixuser1) gid=1(staff)

And i've used rsh long back, i think rsh will allow users to run few commands which we specify.

but my requirement is, aixuser1 should be able to login as normal. And this user should be able to run all normal user commands on /abc1 directory.

user should not access any other content.

please suggest.
# 5  
Old 03-30-2015
It requires root o set up a chroot jail. Not to be the user trapped in one. If it was not AIX I would suggest chroot.

A chroot jail is:
1. user is limited to the commands you provide
2. user is trapped in his/her directory.

chroot comes from the fact that the root directory for a normal user is the / directory. chrrot manes to change the root directory, such that /home/joe becomes joe's / directory. He can only go down that directory tree to subdirectories.

The reason I am not taking a solid position is that AIX has some 'interesting' features that other UNIX flavors do not have. So for all I know that post I cited is correct. For solaris, for Linux, and for HPUX the answer is chroot jail. Since none of the AIX guys havde answered:

This is for a login account to a chroot jail using openssh.

The Best Linux Tutorials: Openssh with AIX chroot
# 6  
Old 03-31-2015
Thank you Jim, I will check this article/post.
# 7  
Old 04-02-2015
ssh

Good day. If this user is going to be connecting remotely by say ssh, then you can use the "chroot" functionality of openssh itself. You won't have to go through the whole configuration of setting up a 'chroot environment' as openssh will take care of that for you.

Take a look at your /etc/ssh/sshd_config file. You'll see the example section at the end of the file dealing with chroot's.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Is there a way to restrict a user (owner) to execute scripts from a specific directory

Hello, I have a user Bob on a RHEL 7 server1. Where his script area is "/home/Bob/scripts/" and he is the owner for this directory. On the server1, there is a NFS mount from another server2, with path as "/global/work/" and Bob is the owner for this directory too in server2. (Same UID and GID... (5 Replies)
Discussion started by: karumudi7
5 Replies

2. Solaris

restrict sudo and chown in specified directory

Hi Dears, I have one requirement like this: general user A can execute command C with root privilege by sudo configuration some folders and files are created during the command C execution user A cannot access those folders and files because the owner is root user, so I want the user A... (0 Replies)
Discussion started by: crest.boy
0 Replies

3. Red Hat

Restrict user access

Hi there I have an application user on my system that wants accesses to these file systems as such: rwx: /SAPO /SAPS12 /R3_888 /R3_888B /R3_888F /R3_888R r: /usr/sap these are the existing FS permissions:ownerships: # ls -ld /SAPO (9 Replies)
Discussion started by: hedkandi
9 Replies

4. Solaris

How to restrict user to a specific directory in solaris 10

Hi all, I want to create a new user and grant him ONLY transfer files access to a specific directory where he can only upload and read the files. He should be restricted to this activity only. Regards (6 Replies)
Discussion started by: gilldn
6 Replies

5. Solaris

Restrict FTP User to a Directory

I am using Solaris 10 on SPARC. SunOS ddw 5.10 Generic_139555-08 sun4u sparc SUNW,SPARC-Enterprise I have put some text files in a directory '/u01/network' I want to create a ftp user which can just read the files in the network directory. The ftp user shouldn't be able to navigate or see... (4 Replies)
Discussion started by: fahdmirza
4 Replies

6. Red Hat

Restrict user to a particular directory

Hi I have a Fedora10 server and i need a particular user to view files only in a particular folder. All other files in other folders having "read" permission for all shouldn't be accessible to this user. Please let me know if ther's a way. Thanks, HG (5 Replies)
Discussion started by: Hari_Ganesh
5 Replies

7. UNIX for Dummies Questions & Answers

restrict one user to see only his home directory in his profile

Hi I need to restrict one user to see only his home directory and one more directory how i can do this in his profile. The OS is Red hat linux I create a user -- tec and group calle --tec one the user log in he will see /home/tec and he need to see /opt/load this dirctory... (6 Replies)
Discussion started by: aboorkuma
6 Replies

8. UNIX for Dummies Questions & Answers

how do U restrict a user to a single directory?

specifically - I don't need to restrict a user to a single directory - but I want them to be "ROOTED" to their home directory. so if my home directory is /home/onlyme when I login - if I do a pwd - I want to see: / but in real life I will be in /home/onlyme - it just appears as root to... (10 Replies)
Discussion started by: itobenon
10 Replies

9. UNIX for Advanced & Expert Users

Restrict FTP access to a single directory for only one user.

Hi All, It will be very great if you can help me in this issue. Thanks in advance. I need to enable FTP on a solaris9 server. I need to create a new user some "xxxxxx" and he can only FTP the files to and from between /tftpboot directory and network devices. Other users should not... (8 Replies)
Discussion started by: santhoshkumar_d
8 Replies

10. UNIX for Dummies Questions & Answers

Restrict my search to current directory.

Hi every1, There is a folder with .lst files which has email id's of our project group. I want to find files which has my email id starting with sachin but i dont want find command to search subdirectories. I have read about prune but i didnt understand that. I am pretty new in this field.... (7 Replies)
Discussion started by: sachin.gangadha
7 Replies
Login or Register to Ask a Question