Blogs Classifieds Downloads FlashChat Gallery Googlemap Invite Friends Links Projects Reviews Wiki
 


Our Sponsors
Want to advertise?  


Reply
 
LinkBack Thread Tools
  #1  
Old September 25th, 2008
adeel123's Avatar
adeel123 Offline
Member
 
Join Date: February 2008
Posts: 35
How to restrict user to FTP particular folder

Hi,

I made a user on my machine with OS AIX5.3. I have blocked the telnet access of that user and only want to use that user for ftp purpose. now i want that user can only FTP to a particular folder and cannot access or move to any other directory. lets my user home profile is in /abc/adeel/xyz. once user login through ftp will directly drop at this path. but i dont want that user can change the directory. it shuld always remail in this path that is /abc/adeel/xyz. he can not move to any where.
How can i restrict him.

i have already used rksh .but that only work on telnet mode its not working on ftp mode. kindly guide me
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old September 25th, 2008
seth's Avatar
seth Offline
Senior Member
 
Join Date: June 2008
Posts: 293
Re: How to restrict user to FTP particular folder

Hi
I'm curious on this one too. I know the anonymous ftp script delivered wit AIX /usr/samples/tcpip/anon.ftp (part of bos.net.tcp.client) does a similar thing with the anonymous ftp user and limits him into a own directorytree but I don't wanted a anonymous user access. I wanted a normal user with a tough password and limit him to a directory what I want. Not some Filetree below /home/blablabla with links in it. Heard on other sources that changeroot or chroot would do the job but only if used with a special ftpd, well I wanted to keep the ftpd from AIX for security reasons. Anyways I made a test with the wu_ftpd and did not get it working. At that point I gave up...
Maybe some other here got it successfully woring in their environment. If yes please share the information.

Cheers seth
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old September 25th, 2008
mshulman1980's Avatar
mshulman1980 Offline
Member
 
Join Date: October 2006
Posts: 40
Re: How to restrict user to FTP particular folder

What you're trying to do is a chroot jail, which the standard AIX ftpd daemon doesn't support.
The best way to do this is to switch to SFTP, which does support chrooting. Aside from natively supporting chroot functions without installing extra software, you will use a more secure protocol (SSH)
Alternatively, if you need to stay with the FTP protocol, you can get a different FTP package - for example ProFTPd, which does support chroot functions. Here's a tutorial on it:
ProFTPD mini-HOWTO - Symlinks and chroot()


Good luck!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old September 26th, 2008
kimyo's Avatar
kimyo Offline
Member
 
Join Date: February 2007
Location: North Vancouver BC Canada
Posts: 30
Blog Entries: 1
Re: How to restrict user to FTP particular folder

Hi Guys

I have been through the same pain. I also looked at the IBM AIX anonymous script sent with AIX and was NOT keen to have an anonymous user on my system. Finally found what I was looking for, set your user as you have done with only ftp access. Then it is actually very simple, there are 2 ftp config files (both standard txt files):
  1. /etc/ftpusers
  2. /etc/ftpaccess.ctl
The first file I'm sure you know, it just restricts ftp access to any user listed in that file:

#>cat ftpusers
#The follwoing list of users will be restricted from ftp login
root
bin
uucp
ingres
daemon
news
nobody
anonymous

The second file is what you are looking for. There is actullay a full detailed description of how and what to set in the file if just run a man on ftpd. I felt kind of stupid after searching to the end of the web for this info and I found it already detailed in AIX. But not many people know of it? Anyway here is an example of what you would set in the ftpaccess.ctl if you wanted user "ftp" to have login to "/home/ftp", the user will be able to change directory forward but not backwards. Also when user ftp logs in and runs pwd it will show only "/" and not "/home/ftp".

#>cat ftpaccess.ctl
useronly: ftp
readwrite: /home/ftp

This is an absoulte winner. No extra non-AIX software or hacks or annonymous users. I used it on AIX 5.3 TL 06 and had no major issues. I did find that I couldn't get all the functions in the ftpaccess.ctl file to work correctly (dent, thats why I used in conjection with ftpusers). I actually think this comes from Linux and I am not sure what versions of AIX do and don't support this setup. So give it a bash

regards
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old September 26th, 2008
seth's Avatar
seth Offline
Senior Member
 
Join Date: June 2008
Posts: 293
Re: How to restrict user to FTP particular folder

Hi kimyo

That sounds fine, specially the part with the ftpaccess.ctl.
Well ftpusers lacks a really good feature to use it. I would like a more sutiable accesscontroll above the uses. Somthing like "deny all but allow user xyz".
But thanks for the hint anyway!
Have a nice weekend!

Seth
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old September 26th, 2008
kimyo's Avatar
kimyo Offline
Member
 
Join Date: February 2007
Location: North Vancouver BC Canada
Posts: 30
Blog Entries: 1
Re: How to restrict user to FTP particular folder

Hi Seth

If you can get the ftpaccess.ctl file setup correctly then you might be able to set something like deny all (not 100% sure if "all" is recognized) However I think the file is read line by line, so if you had deny all on line 1 and then allow xyz on line 2, that should work? But only if "all" is a recognized entry. I understand that if you have hundreds of users then adding them all will be quite a task, although you could just pull user names in from an lsuser awk'ed or something. Not sure if that is what you were getting at? but give it a try

regards
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old September 29th, 2008
seth's Avatar
seth Offline
Senior Member
 
Join Date: June 2008
Posts: 293
Re: How to restrict user to FTP particular folder

Hmm, I looked now on man ftpd and found the useronly/grouponly directive in the ftpaccess.ctl file. That looks to me that the ftpusers file is obsolte for me and that is fine! Thanks a lot kinyo for the information.
Cheers seth
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old September 1st, 2009
psvillanueva's Avatar
psvillanueva Offline
Junior Member
 
Join Date: May 2007
Posts: 8
Re: How to restrict user to FTP particular folder

one problem i encountered in my setup is i'm not able to view my existing files and also when i transferred files its not visible in my home directory.

thanks,

pete
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old September 23rd, 2009
clehopatra's Avatar
clehopatra Offline
Junior Member
 
Join Date: September 2009
Posts: 1
Question Re: How to restrict user to FTP particular folder

well it seems to be a smart solution to use tftpaccess.ctl with useronly to restrict ftp access to users homedir ....

but
if you are connecting to the server with ftp as this user ,
you will get guest login without the password of the user !!!

that is not what I want
I would like to be asked for ftp users password
I do not wnat to have anonymous login

mmmh - does anybody know a solution for this ?

Regards
clehopatra
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
folder, ftp, restrict, user

These are the 100 most searched terms
Search Cloud
0042-001 0042-001 nim 0042-008 nimsh: request denied 0513-001 the system resource controller daemon is not active 0513-001 the system resource controller daemon is not active. 0514-061 0514-061 cannot find a child device 0514-061 cannot find a child device. 0516-787 0516-787 extendlv 0516-787 extendlv: maximum allocation for logical volume 110000ac 3074feb7 aa00e1f3 aio aix aix aio aix freeware aix memory usage aix rsync aixif_arp_dup_addr b150f22a b181f22a b181fb53 ba010004 bfe4c025 c1001020 d133c002 dacnone dcb47997 fcp_array_err6 fget_config gnu tar aix gtar aix hmc root password hmc vmware ibm p6 520 libpopt.a libpopt.a(libpopt.so.0) is needed by rsync-2.6.2-1 migratelv navisphere agent nim server pseriestech ptype and account type do not match rshd: 0826-813 permission is denied. rsync aix sc_disk_err4 scan_error_chrp vio server vmware hmc websm ... powered by Simple Search Cloud


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Powered by vbWiki Pro 1.3 RC5. Copyright ©2006-2007, NuHit, LLC

vBulletin Skin developed by: vBStyles.com


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80