Operating System - HP-UX
1833163 Members
3589 Online
110051 Solutions
New Discussion

ftp: restrict user to access /tmp/test

 
SOLVED
Go to solution
j773303
Super Advisor

ftp: restrict user to access /tmp/test

I know the way can configure ftp users to access his home directory only.

BUT, Is it possible to restrict FTP users to access /tmp/test only?
Hero
2 REPLIES 2
Steven E. Protter
Exalted Contributor
Solution

Re: ftp: restrict user to access /tmp/test

Shalom,

Yes,

make /tmp/test the home directory of the user in /etc/passwd and use ftpaccess to chroot the user.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
F Verschuren
Esteemed Contributor

Re: ftp: restrict user to access /tmp/test

This how it is posseble:
ps if you have a older system than 11.00 you must download a ftp berkly version to do this

Add â -aâ to ftpd in /etc/inetd.conf
ftp stream tcp nowait root /usr/lbin/ftpd ftpd -a

Create the file /etc/ftpd/ftpaccess (anonftp can be any other group-name but is preferred).
# echo â class any anonymous,guest,real *â > /etc/ftpd/ftpaccess

# echo â guestgroup anonftpâ >> /etc/ftpd/ftpaccess

# echo â log commands guestâ >> /etc/ftpd/ftpaccess

Create the anonftp group:
# /appl/tsu/cur/support/bin/AddGroup.pl â gid ???? anonftp

Add all available shells to /etc/shells.
add /usr/bin/false to /etc/shells


After adding a user to the system for restricted ftp youâ ll have to change the userâ s shell to /usr/bin/false, add ./ to the homedirectory and set the password to non-expiring (donâ t use â vipwâ but use â samâ to do this). An example /etc/passwd entry of a restricted ftp user:
tsuftp:*:4004:4001:TSU Ftp-User,,,:/tmp/test/./,/usr/bin/false

Add the following files and dircetories to the users home directory (make sure the user cannont overwrite them!).
# mkdir ~ftpuser/usr ~ftpuser/usr/bin ~ftpuser/usr/lib ~ftpuser/etc

# cp /etc/group ~ftpuser/etc

# cp /etc/passwd ~ftpuser/etc

# cp /sbin/ls ~ftpuser/usr/bin

# cp /usr/lib/dld.sl ~ftpuser/usr/lib

# cp /usr/lib/libdld.1 ~ftpuser/usr/lib

The passwd file and group file are for user/group id resolving within the ftp session only. It does not hold the user's password.