# setting up anonymous ftp



## couzteau (Jun 11, 2002)

hello

how do i allow anonymous ftp users to login? 

i would like to set the homedirectory of the anonymous user as writeonly on a volume different from the default location for anonymous login.

thanx

couzteau


----------



## chenly (Jun 11, 2002)

Write-only or read-only?


----------



## chenly (Jun 11, 2002)

testuser, you've ported your anonymous ftp instructions to the comand line! Wouldn't "write-only ftp" usually be referred to as a dropbox?


----------



## couzteau (Jun 12, 2002)

thanx testuser, i've pu the pieces together from your addFtpUser-script and created a shell script that does everything from the commandline. 

why is it necessary (may be only on my machine???) that permissions for the homedirectory are worldreadable?


here it is:

#!/bin/sh

uName="ftp"
ftpUserDir="/Volumes/path/to/volume"

listID=`niutil -list . /users uid | awk '{print $2}' | sort -n | tail -n 1`
nextUID=`echo "$listID" + 1 | bc`
sudo niutil -create . /users/$uName
sudo niutil -createprop . /users/$uName uid $nextUID
sudo niutil -createprop . /users/$uName gid -1
sudo niutil -createprop . /users/$uName shell /bin/tcsh
sudo niutil -createprop . /users/$uName home "${ftpUserDir}/$uName"

sudo niutil -createprop . /users/$uName passwd ""


# Create ftp directory
sudo mkdir -p "${ftpUserDir}/$uName"
sudo chown ${uName}:staff "${ftpUserDir}/$uName"
"${ftpUserDir}/$uName"
sudo chmod 333 "${ftpUserDir}/$uName"

------

ps: a drop box is actually what i had in mind


----------



## sjb2016 (Jul 8, 2002)

I'm trying to setup an ftp server, and I want to serve the contents of this folder

"/localhost/Users/sam/Music/MP3's/John Digweed/Kiss"

However, after following the above instructions in step one by typing this:

[syr-24-169-80-4:~] sam% sudo niuti -create . /users/ftp home "/localhost/Users/sam/Music/MP3's/John Digweed/Kiss"

I try step two:

[syr-24-169-80-4:~] sam% niutil -destroy prop /users/ftp realname

and get this:

niutil: can't connect to server for domain prop

What am I doing wrong, something with file name paths or something.  If you can help, thanks  in advance.


----------



## sjb2016 (Jul 9, 2002)

As I only really need people to have access to the music I place in the public folder, is there a way that I could put files in the Public folder of the ftp user's account and then when people go to ftp://johndigweed.kicks-ass.net they would only see the public folder and nothing else clutering their view (like desktop, documents folder etc).  It's more of a looks thing, but since none of those other folders have anything in them, I'd like them gone, plus there would be less places for hackers or whatever from hiding things.  Thanks


----------

