Subject: [306] File Permissions on ~ftp

From: "Saminda Lam, CCST HKUST, Tel: 358-6209" <[email-masked]>
Date: Mon, 8 Aug 1994 16:57:41 HKT

I have installed wu-ftp on Solaris 2.3 and would like to know the
appropiate file protection on ~ftp.

The anon-ftp FAQ suggests:

	Make the directory owned by root (NOT ftp) with the same
	group as ftp.

The ftpd manual on Solaris 2.3 says:

	Make the home directory owned by ftp and unwritable by
	anyone. This directory should not be on a file system
	mounted with the nosuid option.

Which is more secure?

Thanks in advance,
Saminda Lam ([email-masked])

---

From: Daniel O'Callaghan <[email-masked]>
Date: Mon, 08 Aug 1994 20:11:05 +1000 (EST)

> 	Make the directory owned by root (NOT ftp) with the same

If you make ~ftp owned by root and in group ftpgroup, you need to make 
sure that you don't give group write access to ~ftp.  I'd create a 
special group of people who can write to ~ftp and make it owned by that 
group, if you want to use group write perms.  That's how one of my anon 
sites is set up.
 
> 	mounted with the nosuid option.

Unix file/directory permissions are pretty secure, but Sun's ftpd does 
not implement the CHMOD verb which some (wu-ftpd?) do.  If your ftpd 
supports chmod, and ~ftp is owned by ftp, then an anonymous user could 
conceivably 'chmod 777 /', followed by 'PUT .rhosts' and then rlogin, rcp or 
rsh.

> Which is more secure?
I'd go for root.ftpers ownership or similar.  Make ~ftp mode 775, and put 
yourself in group ftpers.  DON'T put ftp in group ftpers.
Additionally, make the login shell of user ftp /bin/anonftp and put 
/bin/anonftp into /etc/shells.  /bin/anonftp should not actually exist.
This is just in case someone does manage to rlogin - they'll have no 
shell and get logged out again.  Or you could put the following into 
/bin/anonftp (and make it executable)
---------
#!/bin/sh
echo "ALERT!!!" | mail -s Anonftp_login_attempt [email-masked]
----------
regards,

Danny