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

Read up on chroot jail:

Best Practices for UNIX chroot() Operations

You can also use Zones for this. You can make a sparse zone and make the filesystem read only. He can not escape to the global zone.

You can combine a chroot environment with a custom shell like RSSH

Think You are looking for this.

Procedure to configure FTP guest user access

1: Create a user which you want to use for the ftp , Name of the user can be anything except "ftp" ( In our Example it is "ali")

Useradd  -g  10  -d  /export/home/ali  -m  -s  /bin/bash  ali
passwd ali
Enter the new password twice .

2: Run the "ftpconfig -d" command , on the home directory of newly created user.

\# ftpconfig �d   /export/home/ali
this updates the existing directory with the info needed to make the account restricted.
After this you can see some extra directories in /export/home/ali e.g   bin, dev,lib e.t.c 

3: Add the user to the /etc/ftpd/ftpaccess file. There is an existing commented entry
# guestuser username
that can be uncommented and edited

  guestuser   ali

4: Confirm that the user is a member of a class in /etc/ftpd/ftpaccess this entry should a already exist in ftpaccess
class guestusers guest *

5: Modify permissions for guest user if necessary

delete no anonymous,guest # delete permission?
After this user ali will not be able to delete any file .

6: Run the command
# in.ftpd -a to allow the use of ftpaccess file

now when user "ali" ftps to this server

ftp 10.30.21.33
Connected to 10.30.21.33.
220 solarislab FTP server ready.
Name (10.30.21.33:solarisuser): ali
331 Password required for ali.
Password:
230 User ali logged in. Access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/" is current directory.
Note that now you will see �/� as your current directory instead of /export/home/ali.

2 Likes

Thanks a lot,
I have created ftp user successfully ! I am alos trying to give that user rbash shell where I have read it will restrict perticular user from viewing other directory but when I am trying to login its showing invalid user.
Is it necessary to use rbash to restrict from directory to perticular user or any other option is there plz let me know

Regards
Taher

Dear Taher,

i cannot understand why u need rbash right now. the given proicedure will restrict the user to its home directory