Re: ftpusers file

 
SOLVED
Go to solution
John Poff
Honored Contributor

Re: ftpusers file

Gary,

You're welcome. I'm glad I could help you. I'd much rather hear that I helped somebody solve a problem than to get a bunch of points! :)

JP
OneNeck UNIXSA
Frequent Advisor

Re: ftpusers file

Or you can make a group, lets say, ftpallow and assing userids allowed to ftp to it. Once this is done you can create a cron job with the following script, edit for your environment, this one is for NIS.

#!/sbin/sh
cp -p /etc/ftpd/ftpusers /etc/ftpd/ftpusers.old

/usr/bin/ypcat passwd | awk -F: '{ print $1 }' > /etc/ftpd/ftpusers

for user in $( /usr/bin/ypcat group | grep ftpallow /etc/group | awk -F: '{ print $4 }' | sed -e 's/,/ /g')
do
grep -v "^$user" /etc/ftpd/ftpusers > /etc/ftpd/ftpusers.new
cat /etc/ftpd/ftpusers.new > /etc/ftpd/ftpusers
rm /etc/ftpd/ftpusers.new
done
Hamdy Al-Sebaey
Regular Advisor

Re: ftpusers file

Joe,

For TCP-wrapper,it'll give you how is allowed to login to the sever, how is deny. I think it's not a good idea,you need only to allow & deny some users.
So the best way is the following both files ftaccess en ftpusers.

Regards,
Hamdy
Thanks for sharing knowledge
Centric Group 18
New Member

Re: ftpusers file

Have you looked at /etc/ftpd/ftphosts file?

#ftphosts
#action user hostmask
accept root *
accept ftpuser *
deny * *

I don't really know if the deny all is needed, but this worked for me.