Hi!
First you need to check as what user your webserver (=PHP) runs. This is one "person" that needs access. Let's say, PHP runs as "wwwrun-rj".
Now you yourself want access with FTP, too. Let's say your username is "rj".
So you need to make sure that the user of your webserver runs in the same group like your FTP user. Let's say both wwwrun-rj and rj are members of the group "web-rj".
What you can do now is to change the ownership of ALL files and directory to user "rj", group "web-rj". Then change the permissions for the owner (first bit) to "7" (rwx). This will allow your FTP user to have full access to everything. The other bits are "00", so the full permission bitmask would be "700".
Now to ensure access to all s9y files, assign the permissions for the group (second bit) to "7" (rwx), but nly to those files and directories that are mentioned in the s9y FAQ. Like templates_c, serendipity_config_local.inc.php. This will basically set all those files/dirs to "770".
All other files will be left unmodified, which means that "other users" will always have no access to your files.
Now, depending on your provider this setup may vary, so you might need to react differently to what he enforces.
(In a usual setup, the files you upload to FTP are always assigned to your FTP user, and the only things you need to change is to give write privilegs to the files mentioned in the s9y FAQ. But the FAQ, for ease of use, tells users to use '777', because we cannot anticipate every possible variation in a hoster's setup. 777 will always work, but will always be 'too broad'. But better to have a working setup for an installation than to confuse users with the security intrinsical features. But since you are eager to know, you'll need to get yourself familiar with the user/owner/group permission bits.)
Regards,
Garvin