[lug] ftp how-to

Geoff Baysinger jahf at yahoo.com
Thu Jan 2 22:37:40 MST 2003


--- Kirk Rafferty <kirk at fpcc.net> wrote:
> On Thu, Jan 02, 2003 at 02:00:05AM -0700, Nate Duehr wrote:
> > I can say I'm happily using vsftpd (and the crazy default "beat me!
> > break me!" READY message -- hah!) ...
> 
> Speaking of which, do you or anyone else know how to change this
> message
> without modifying code?  I *really* don't want to encourage anyone to
> beat on my FTP server. :)

Greetings,

Quick intro since I'm new to the list ... we (my wife, 7 cats and
myself) moved from Murfreesboro, TN to Nederland, CO this past fall.
I'm just now getting around to finding the local users groups and
joined this list today. I've been using Linux professionally since 1996
in various jobs (ISP admin, travelling sales engineer, support
engineer, marketing technology specialist, etc) and currently work for
Sun, though I know Linux much better than I know Solaris. I mostly use
Red Hat 8 and it's variations like Cobalt Linux and Sun Linux but have
installed a few working Gentoo systems and am currently engrossed in
learning my Zaurus. 

Anyway, that's out of the way :) 



To answer your question ...

You can't. Unfortunately, vsftpd chose to hard-code the string. I was
thinking of doing exactly the same change and brushing up on my source
RPM skills today when I found this message so I'll just document the
process below. It's really not that hard to change the string but you
do have to recompile.

Note ... please sanity check the following commands if you use them ...
I don't want to be responsible for goofing your system. I had this
whole message typed up but Yahoo! decided my session had expired and
chunked the original writeup so the following is from my .bash_history
and memory.

/Geoff

# NOTE: The following is considered pseudo-script ... I didn't test
# it out as a true shell script. Though all should work, run commands
# individually to do error-checking.
#
# Email may wrap lines. Each command is separated by a following line
# break. Make sure to join any lines that may have wrapped.

# If you don't have the SRPMs on CD, grab the source via:
ncftpget
ftp://ftp.redhat.com/pub/redhat/linux/8.0/en/os/i386/SRPMS/vsftpd-1.1.0-1.src.rpm


# Install the source RPM:
rpm -ihv vsftpd-1.1.0-1.src.rpm


# Go to the installed source directory:
cd /usr/src/redhat/SOURCES


# Unpack the source code from it's tarball
tar zxvf ../vsftpd-1.1.0.tar.gz


# replace the inviting text, remember, the following is 1 command
cat vsftpd-1.1.0/prelogin.c | sed 's/beat me, break me/I will
survive!/' > vsftpd-1.1.0/prelogin.c


# remove the now stale source tarball
rm vsftpd-1.1.0.tar.gz


# create a replacement source tarball
tar zcvf vsftpd-1.1.0.tar.gz vsftpd-1.1.0


# move over to where we keep the RPM spec file
cd ../SPECS/


# build a new binary RPM based on the spec file and source code
rpmbuild -bb vsftpd.spec


# rename the resulting binary RPM so we don't confuse it with the one 
# from Red Hat.
# 
# NOTE: the version in the RPM stayed the same, which means Red Hat 
# Network / up2date / rpm will not realize that we have changed the 
# package. In this case this is OK since we didn't alter any of the 
# original functionality. If we had modified functionality, you would
# want to update the Version number in the vsftpd.spec file, and would
# be able to skip the following command.
mv ../RPMS/i386/vsftpd-1.1.0-1.i386.rpm
../RPMS/i386/vsftpd-1.1.0-1.custom.i386.rpm


# Backup our xinetd vsftpd configuration
# NOTE: Using the "upgrade" (-U) switch with RPM means we really
# shouldn't need to backup our configs, but better safe than sorry
cp /etc/xinetd.d/vsftpd /etc/xinetd.d/vsftpd.bak


# backup our main vsftpd configuration
cp /etc/vsftpd.conf /etc/vsftpd.conf.bak


# backup our list of users who can not ftp to the machine 
cp /etc/vsftpd.ftpusers /etc/vsftpd.ftpusers.bak


# this file normally has the same effect as vsftpd.ftpusers, but I use
# it with the vsftpd.conf file to create a list of users who
explicitely
# -can- use the ftp server (add "userlist_enable=YES" and 
# "userlist_deny=NO" to /etc/vsftpd.conf to set this up). 
cp /etc/vsftpd.userlist.conf /etc/vsftpd.user_list.bak


# Finally, we can upgrade the rpm ... we need to --force here 
# because rpm will think we already have this package otherwise
rpm -Uhv --force ../RPMS/i386/vsftpd-1.1.0-1.custom.i386.rpm


# test to see if it worked, should come up immediately if you 
# had vsftpd enabled in /etc/xinetd.d/vsftpd:
ftp localhost

# done



__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



More information about the LUG mailing list