Troubleshooting SafeTP

sftpd (unix server) Installation

The install script, sc/install.pl, should get everything in order automatically. However, you may want to verify that. These are the things to check:

If the install script has failed, you may want to consult install.txt (included in the distribution) for manual install instructions.

Testing the ports setup

If things aren't working, the first step is to verify that each of the relevant ports is being "answered" by the right program. For example:

  scott@leetch:~% telnet localhost 21
  Trying 127.0.0.1...
  Connected to localhost.
  Escape character is '^]'.
  220-leetch.pasture.cow FTP server ready.
  220-*** This server can accept secure (encrypted) connections. ***
  220 *** See http://safetp.cs.berkeley.edu for info. ***
  ^]
  telnet> close
  Connection closed.
  
From this fragment we can see that sftpd is listening to port 21, and is successfully connecting to ftpd (because the 220 message includes the info about wu-ftpd).

Possible problems at this stage include:

We can also investigate ftpd itself:

  scott@leetch:~% telnet localhost 351
  Trying 127.0.0.1...
  Connected to localhost.
  Escape character is '^]'.
  220 leetch.pasture.cow FTP server ready.
  ^]
  telnet> close
  Connection closed.
  
Again, possibilities include connection-refused or connection-closed. A problem at this stage is not related to sftpd. Check the documentation for ftpd and inetd, and tcpd if you're using it. Until you can manually telnet to ftpd and get a 220 response, sftpd won't be able to, either.

Try it with sftpc

sftpc(1) is the unix command-line SafeTP client. Try using it to connect to sftpd:

  scott@leetch:~% sftpc localhost
  sftpc version 1.40
  Connected to localhost (127.0.0.1, port 21).
  220-leetch.pasture.cow FTP server ready.
  220-*** This server can accept secure (encrypted) connections. ***
  220 *** See http://safetp.cs.berkeley.edu for info. ***
  Starting negotiation...
  Public key for 127.0.0.1: SafeTP at leetch.cs.berkeley.edu [10/14/1999]
  235 Security data exchange complete.
  211 DIGT=uh9Iqi/mtOZUSbnuMqBlRGVdA+s=
  Negotiation completed.
  200 The PBSZ is ok.
  200 Data channel protection set to 'private'.

  User name (Enter = scott)?
  
If this works, log in, and issue the "test" command. This will test many features of sftpc and sftpd, including transfers under all combinations of data encryption on/off and passive/active mode. If it works locally, but you're having problems connecting from a remote site, build sftpc there and try it from the remote site.

Ideas for experimentation:

Try running sftpd from the command line

From the command line you can interactively try things much more easily than with inetd, and see diagnostic messages on the console. However, sftpd will only handle a single connection when run this way, so it's only useful for debugging.

Be sure to tell sftpd where to look for its keys, by supplying the -y switch. You can create keys using the 'makekeys' standalone program. See sftpd(8) for more info on command-line options.

Example command line:

  scott@leetch:~/sftpd% ./sftpd -p3333 -f351 -y/tmp/scott
  

Ideas for experimentation:

Trouble with the Windows client

The Windows client has its own documentation. However, one key fact is that the Windows client only secures connections to specific ports -- currently limited to ports 21, 353 and 2123. If you're troubleshooting problems with the client, be sure to run sftpd such that it listens to one of these ports.

General tips

If all else fails

If you can't get it working, email me! Send me: