Restrict FTP User to a Directory


 
Thread Tools Search this Thread
Operating Systems Solaris Restrict FTP User to a Directory
# 1  
Old 11-22-2010
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 any other directory outside of the network directory.

Please advise.
# 2  
Old 11-22-2010
Change user's home directory to /u01/network:
Code:
usermod -d /u01/network ftp_user

Then add:
Code:
restricted-uid ftp_user

to /etc/ftpd/ftpaccess file.
This User Gave Thanks to bartus11 For This Post:
# 3  
Old 11-22-2010
bartus11, thanks.

After following your steps, when I try to login to the ftp server, I receive following error:

C:\>ftp 193.162.1.1
Connected to 193.162.1.1.
220 ddw FTP server ready.
User (193.162.1.1Smilienone)): ftp_user
331 Password required for ftp_user.
Password:
530 User ftp_user: can't change directory to /u01/network.

Login failed.
ftp>

The user ftp_usr is the owner of /u01/network directory.

Following are settings in /etc/passwd:

ftp_user:x:3008:1::/u01/network:/usr/bin/ftp-only

The settings in the /etc/ftpd/ftpaccess:

allow-retrieve relative class=realusers /u01/network

restricted-uid ftp_user

Please advise.
# 4  
Old 11-22-2010
I think there needs to be 755 rights mode on "/u01".
This User Gave Thanks to bartus11 For This Post:
# 5  
Old 11-22-2010
I gave 755 rights on the /u01,and it works.

Details are at Pakistan's First Oracle Blog.

---------- Post updated at 08:57 PM ---------- Previous update was at 08:48 PM ----------

Here is the full link to detail:

Pakistan's First Oracle Blog: Restrict FTP User to a Directory in Solaris
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. AIX

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; Filesystem GB blocks Used Free %Used Mounted on /dev/hd4 2.61 1.02 1.59 40% / /dev/hd2 ... (7 Replies)
Discussion started by: aaron8667
7 Replies

3. 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

4. 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

5. 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

6. Solaris

when FTP user will go to specific directory

Hi experts, I have a user "bingo" in my sunsolaris 9. # /etc/passwd bingo:x:513:1::/export/home/bingo:/bin/bash when anyone Telnet to this user it goes to his home directory /export/home/bingo But now i want- when someone FTP to this user "bingo" it will NOT go to his home dir. Rather it... (5 Replies)
Discussion started by: thepurple
5 Replies

7. 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

8. 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

9. Solaris

lock user to directory in ftp

how can i lock a specific user to his home directory when he logs on to the computer with ftp? thanx! (3 Replies)
Discussion started by: eliraza6
3 Replies

10. UNIX for Dummies Questions & Answers

Specifying FTP user Home Directory

Hi, I am running Solaris 10 and I am using the ftp server that comes with it. I would like to specify a specific directory as ftp user's home directory. For example, if "ftpuserx" ftps into my solaris machine, they will automatically be taken to "/space/web" directory, even though there... (0 Replies)
Discussion started by: annointed3
0 Replies
Login or Register to Ask a Question