Run a simple, single-user ftp server instantly from the command line to enable easy file transfer between two machines. no installation required, fully portable executable for Windows, Mac OS X and Linux.
sfk ftpserv [-h[elp]] [-port=nport] [-rw] [workdir]
The SFK Instant FTP Server for easy file transfer.
default behaviour since SFK 18.104.22.168:
* the CURRENT DIRECTORY is made accessible, WITH subdirs.
* any kind of directory traversal (.., / etc.) is blocked.
* just ONE CLIENT (browser etc.) can connect at a time.
if another client connects, the first is auto closed.
* after 60 seconds of inactivity, the connection is closed.
* filenames with accents are sent as is (no UTF8 support).
* with -rw, files of any size can be written (no size limit).
* with -rw, existing files are overwritten without asking.only for trusted environments!
sfk ftpserv is intended only for personal file transfer
between two machines that the user has control of, within
a trusted LAN environment. it should not be used to offer
files in the internet. if security is important then do not
use sfk ftpserv but a full scale FTP server like FileZilla.
-port=n use other port than default, e.g. -port=10000.
-port2=n alternative port, used if first port fails.
use -port2=0 to disable alternative port.
-pasvport=n define a fixed port for PASV connections.
default is to allocate a random port defined
by the operating system.
-pw=x require primitive authentication, i.e. client
must provide password x to login. you may also
set an environment variable like:
or set SFK_FTP_SPW=mypassword
with the latter one being used only by the
sfk ftpserv command, but not by sfk ftp.
-user=x require this username. if not specified then
any username can be used. can also be given
by environment variable SFK_FTP_USER
-timeout=n set timeout to n seconds. default is 60.
-rw allow read+write access. default is readonly.
-maxsize=n set size limit per file write to this, e.g.
10m = 10 mbytes. default is no size limit.
-minspace=n set required free disk space for file writing,
e.g. -minspace=200m requires 200 megabytes.
-noclone do not try to replicate time stamps on a file
transmission from an sfk ftp client.
-verbose list the transmitted ftp commands.
helpful to get more infos in case of errors.
-showerr[or] print all sent 5xx replies to terminal,
except for 550 no such file. default is to
print them only with -verbose.
-quiet[=2] print less or no status informations.
-nosub block sub directory access, e.g. the client
may NOT say "put the/sub/dir/document.txt".
-run allow client to execute system commands.
requires -pw option being set as well.
requires an sfk ftp client to run commands.
-runpw=x require authentication only for run commands.
can also be set via the environment:
or set SFK_FTP_SRUNPW=mypassword
-ownip=x if client sends PASV command, by default the
-ownip x server replies with the first network interface
IP found. if this is the wrong one, you may
supply a different IP here (as n.n.n.n).
-noclose do not auto close first client connection
if another client tries to connect.
specific single work dir:
instead of making the current directory accessible
you may set a folder name like sfk ftpserv mydir
to allow access to these contents only.
multi directory mappings:
instead of making the current directory accessible
you may specify folders (with virtual names) like:
-usedir C:\audiofiles D:\images=picaliases
sfk sftserv ... = the same as sfk ftpserv, but using port 2121.
transfer protocol selection
since SFK 1.8.5, when using "sfk ftpserv" at the server
and "sfk ftp" at the windows client, plain FTP protocol
is used to avoid firewall restrictions via port 21.
to use SFT Simple File Transfer for better connectivity
and cput/cget support run the server as "sfk sftserv"
and the client as "sfk sft", which will use port 2121.
since SFK 1.6.7, when using the SFT protocol,
linux file attributes are sent and written at the receiver,
except for file owner 'rw' flags which are set by default
to allow rewrite in future transfers. when sending from
linux to windows attributes like 'x' get lost.
problems and solutions:
if you try to login to the server using a regular ftp client, but
you cannot connect and/or transfer files, then usually there is a
firewall or network configuration incompatible to normal FTP.
- if your ftp client provides a command "passive", then type that,
press enter, and then try the usual commands like dir, get or put.
- use "sfk sftserv" at the server and "sfk sft" at the client.
this will use a different protocol (SFT) via port 2121 with
which you often can transfer files even if normal FTP fails.
- Windows: the firewall may stop sfk to sfk file transfer on
port 21, with error ECONNRESET, if your sfk client is old.
use the sfk 1.8.5 ftp client which uses plain FTP.
- Windows 7 Starter: you may have to open the firewall settings
and enable incoming connections for application "sfk" manually.
- Windows: whenever running sfk.exe in an ununsual user context,
e.g. from a mounted virtual drive, or a non-admin shell, this
may cause the system to block incoming connections.
- some FTP clients must be configured not to use multiple transfer
connections in parallel (FileZilla: edit/settings/transfers)
- virtual machines: when using NAT network adapter mode you may
not connect from the host into the guest but only vice versa.
you may configure port forwards in the VM's adapter settings,
then connect to 127.0.0.1:portnumber but not to the IP shown
in the guest. also read the VM's help on adapter modes.
known compatible ftp clients:
WinSCP (in FTP mode), WS_FTP95, FileZilla, command line ftp
known incompatible ftp clients:
Windows Explorer FTP (requires unsupported multi connections)
see alsosfk ftp the sfk ftp client
sfk sft the sfk sft client
sfk httpserv the sfk instant http server
- to run a 'real' ftp server (port 21) for non sfk clients:
sfk ftpserv -user=foo -pw=bar mydir
require the given user/pw and allow read only access to mydir
and all subdirectories of mydir.
sfk ftpserv -rw -usedir website/images=pic /Musik/audio=audio
allow read/write access to website/images with virtual folder
name "pic" and to /Musik/audio as just "audio".
- if you just want quick and simplest file transfer between two
machines both having sfk, use this:
sfk sftserv -rw
run an sfk simple file transfer server, using port 2121,
allowing read/write access to current dir and all sub dirs.
then use "sfk sft" at the client side. should no connection
be possible run the server and/or client with admin rights
and check the firewall settings.
file transfer between windows and vmware linux
the sfk ftpserv function was originally created to enable file transfer
between a windows host and vmware guest OS, as I saw no other way
to accomplish this. for detailed instructions, read on here.