• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

FTP anonymous file server.

yestermac

Active member
I'm using an old version, 1.6 of NetBSD and I'm having a devil of a time setting up an anonymous ftp server. I've read the man pages on ftpd, ftpd.conf, ftpchroot, inetd, inetd.conf and ftpusers. I can ftp using a normal user but can't get anonymous to work. Do I make a user called guest or ftp or anonymous with group guest? I've tried all these. guest user fails after password (I have no password set, but would like ftp users to use their e-mail address. anonymous fails before it gets to the password prompt. I restart inetd (/usr/execlib/ftpd) after every change. Does anyone have a working example of their ftpd.conf, ftpchroot, ftpuser, passwd entries? I can post what I have if that'll help figure this out.

 

yestermac

Active member
Your mileage may vary, but this is basically all I did.

Uncomment these 2 lines in inetd.conf

ftp stream tcp nowait root /usr/libexec/ftpd ftpd -ll

ftp stream tcp6 nowait root /usr/libexec/ftpd ftpd -ll

Sample ftpd.conf file.

checkportcmd all

homedir /home/ftp

chroot guest /home/ftp

limit guest 50 ftptoomany

limit localguest -1

Sample of ftpusers. Add ftp user and anonymous user.

root deny

toor deny

ftp allow

anonymous allow guest (I'm not sure this is really needed)

* deny

Create the root directory you specified in ftpd.conf. The directory should be owner "root" and group "wheel".

I used this command while logged in a root.

mkdir /home/ftp

Create the user called ftp. Don't set a password for the user and don't give it a login shell.

useradd -b /home/ftp -d /home/ftp -g guest -s /sbin/nologin ftp

The entry in your password file should look like this.

ftp:*:1001:31::/home/ftp:/sbin/nologin

Restart inetd.

inetd restart

If all goes well you should now be able to login as "anonymous"

 
Top