January 28, 2015

Local FTP Server on OSX


To start a local FTP server : 
$ sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist

To stop local FTP server : 
$ sudo -s launchctl unload -w /System/Library/LaunchDaemons/ftp.plist

To connect to FTP server : 
Maheekas-MacBook-Pro:~ maheeka$ ftp localhost
Trying ::1...
Connected to localhost.
220 ::1 FTP server (tnftpd 20100324+GSSAPI) ready.
Name (localhost:maheeka): maheeka
331 User maheeka accepted, provide password.
Password: 
230 User maheeka logged in.
Remote system type is UNIX.
Using binary mode to transfer files.

ftp> 

Once connected, most of normal file system related commands will work similarly.


ftp> pwd
Remote directory: /Users/maheeka
ftp> mkdir test
257 "test" directory created.
ftp> cd test
250 CWD command successful.
ftp> mkdir newfolder
257 "newfolder" directory created.
ftp> ls
229 Entering Extended Passive Mode (|||50051|)
150 Opening ASCII mode data connection for '/bin/ls'.
total 0
drwxr-xr-x  2 maheeka  staff  68 Feb  1 10:02 newfolder
226 Transfer complete.
ftp> pwd

Remote directory: /Users/maheeka/test

For a complete reference of ftp commands refer : http://krypted.com/commands/ftp-commands/

To access FTP Server from browser :

Type ftp://username:password@localhost/ on address bar.


Reference : 

No comments:

Post a Comment