tested on RHEL? / artful-bionic / slackware142
RHEL
rpm -q gcc make byacc
Ubuntu
apt install build-essential byacc
Slackware
(you're good)
eventually get rid of the skeletons
mv -i /etc/skel/ /etc/skel.dist/ mkdir /etc/skel/
eventually create some user for authenticated sessions to work too
useradd -m storage passwd storage
eventually create a guest account for anonymous usage
grep ^ftp: /etc/passwd grep ^ftp /etc/group #nbsd useradd -d /tftpboot -k /dev/null -s /sbin/nologin ftp #lignux useradd -M -s /bin/false ftp
gives on netbsd
ftp:*************:1000:100::0:0::/tftpboot:/sbin/nologin
gives on debian/ubuntu
ftp:x:UID-HERE:GID-HERE::/home/ftp:/bin/false
gives on slackware
ftp:x:14:50::/home/ftp:/bin/false
and eventually change ftp
user’s home directory to something useful – be it a directory listing or some PXE repository
vipw #slackware PXE server ftp:x:14:50::/tftpboot:/bin/false
NO NEED TO GIVE A SHELL for the anonymous ftp
user! The guest account works even so.
Check for latest tarball and
wget https://ftp.netbsd.org/pub/NetBSD/misc/tnftp/tnftpd-20200704.tar.gz wget https://ftp.netbsd.org/pub/NetBSD/misc/tnftp/tnftpd-20200704.tar.gz.asc # A4186D9A7F332472 gpg --verify tnftpd-20200704.tar.gz.asc tar xzf tnftpd-20200704.tar.gz cd tnftpd-20200704/ ./configure --sysconfdir=/etc --localstatedir=/var --without-pam # --with-blacklist echo $MAKEFLAGS make make install
handy symlinks
cd ~/ #nbsd cp /usr/share/examples/ftpd/ftpd.conf /etc/ftpd.conf.dist mv /etc/ftpchroot /etc/ftpchroot.dist mv /etc/ftpusers /etc/ftpusers.dist ln -s /etc/ftpchroot ln -s /etc/ftpd.conf ln -s /etc/ftpusers ln -s /usr/local/etc/ftpchroot ln -s /usr/local/etc/ftpd.conf ln -s /usr/local/etc/ftpusers vi /etc/ftpd.conf #newfile vi /usr/local/etc/ftpd.conf #newfile motd all none umask chroot 022 umask real 022 #firewall #portrange all 70000 70999 #NAT #advertize all FRONT-FACING-IP vi /etc/ftpusers #newfile vi /usr/local/etc/ftpusers #newfile storage allow chroot ftp allow guest anonymous allow guest * deny
mkdir /tftpboot/incoming/ chmod 777 /tftpboot/incoming/ chmod +t /tftpboot/incoming/
on netbsd you get
----rw---- 1 ftp wheel 3 Apr 14 11:31 ok
on slackware you get
----rw---- 1 ftp ftp 3 Apr 1 10:31 ok
trying to retrieve
get: Access failed: 550 ok: Permission denied.
trying to override
put: Access failed: 553 ok: Permission denied.
and you may add some check in the daily cron job
vi /etc/daily echo content of /tftpboot/incoming/: find /tftpboot/incoming/ echo
Ubuntu
apt search fortune apt install fortune fortunes /usr/games/fortune -n 40 -s | head -1
Slackware
/usr/games/fortune -s | head -1
and use it below as -V
NetBSD
echo ftpd=yes ftpd_flags="-ll -V ''" >> /etc/rc.conf /etc/rc.d/ftpd start ps auxww | grep ftpd
GNU/Linux
vi /etc/rc.local echo -n starting lukemftpd... /usr/local/libexec/tnftpd -D -4 -ll -V "" && echo done || echo FAILED ps auxfww | grep ftpd
telnet localhost 21 quit ftp -a localhost