Operating System - Linux
1830241 Members
1687 Online
109999 Solutions
New Discussion

Re: Restricted FTP in linux 7.2

 
shajith_1
Occasional Contributor

Restricted FTP in linux 7.2

Dear All

Can any body send me the configuration of restricted FTP on Linux .

Thanking You

Shajith.T
lp is not working for the normal users in hp-ux 10.20
8 REPLIES 8
Alexander Chuzhoy
Honored Contributor

Re: Restricted FTP in linux 7.2

what do you want to restrict?
Trying to guess:
if you want to restrict the IP addresses from which the connection is allowed:
edit the confiuration file of your ftp server-it suppose to be under /etc/xinetd.d
add a line :
only_from = x.x.x.x
where x.x.x.x is the address/subnet from where the connection can be established.

or
no_access = x.x.x.x
where x.x.x.x is the address/subnet from where the connection can not be established...
Best regards
SHAJITH_2
Occasional Contributor

Re: Restricted FTP in linux 7.2

I wanted to Restrict people to access other than his home directory.
aparna challagulla
Valued Contributor

Re: Restricted FTP in linux 7.2

Hi Shajith,

You can restrict a user to a directory by using ftpaccess and chroot.
Pl go thro the manpages for details

HTH
aparna

If you don't have time to do it right you must have time to do it over
Jerome Henry
Honored Contributor

Re: Restricted FTP in linux 7.2

Which server do you use ? Wu-ftpd ? Proftpd ?

J
You can lean only on what resists you...
SAravanan_7
Advisor

Re: Restricted FTP in linux 7.2

we are using wu-ftp
frans tigelaar
Occasional Advisor

Re: Restricted FTP in linux 7.2

Hi,

You can do a lot of things but say you want to use guest accounts in a chroot. You can do this:

Assume that: $1 = user, $2 = pass, and ftpdir = /var/ftp/users

I'll skip the part of making the jail.

******************************************

useradd -d /var/ftp/users/./users/$1 -m -c "FTP guest user" -g ftp-u -s /dev/null -p $2 $1
chattr -i /ftp/users/etc/passwd
tail -1 /etc/passwd >> /ftp/users/etc/passwd
chattr +i /ftp/users/etc/passwd
echo "upload /var/ftp/users/users /$1 no" >> /etc/ftpaccess
rm -f /var/ftp/users/users/$1/.*
cp /ftp/etc/welcome.msg /ftp/users/users/$1/.message
mkdir /ftp/users/users/$1/incoming
mkdir /ftp/users/users/$1/outgoing
chmod 700 /ftp/users/users/$1/*
chmod 444 /ftp/users/users/$1/.message
chown -R $1:ftp-u /ftp/users/users/$1
chown ftp:ftp-u /ftp/users/users/$1/.message

Martin P.J. Zinser
Honored Contributor

Re: Restricted FTP in linux 7.2

Are these "regular" users with a shell account, or ftp only users?
frans tigelaar
Occasional Advisor

Re: Restricted FTP in linux 7.2

These are ftp-accounts only. I gave them a /dev/null as shell. When you build a jail don't forget to make a null device in the jail e.g. /ftp/users/dev/null