Your browser does not allow storing cookies. We recommend enabling them.


Debugging File Transfer

The return codes and error messages should be sufficient to explain most errors. Check that the code and message are correct by looking at the results:

  • Was the file transferred OK but the error code wrong?

  • Was the error code 0 but the file corrupted?

To diagnose file transfer problems, take a trace. If possible, also take a trace of a similar but successful run and compare the two traces. To get traces that can be compared with a diff command, use a trace format without "%Dx" or "%p" specifiers:

SSH_DEBUG_FMT=" %m/%s:%n:%f %M"

To trace the generic file transfer level, use the debug string 'sftp*=14'.

To trace the z/OS low level, use the debug string '*mvs*=7'.

To trace both, use 'sftp*=14,*mvs*=7'.

To get the trace for the client end, put the debug string on the command line, for example:

$ sftpg3 -D "sftp*=14" 

To get the trace for the client end when using sftpg3, use the debug command:

sftp> pwd
sftp> lpwd
sftp> debug sftp*=14,*mvs*=7
sftp> sput tmp.txt //TMP.TXT
sftp> debug 1

To get the trace for the server end when using sftp/scp, create, on the remote machine, the file $HOME/.ssh2/environment, and put in a line like this:


To make the debug at the server end go into a HFS file at the server, add this line in the $HOME/.ssh2/environment file:


Want to see how PrivX can help your organisation?

Are you a DEVELOPER accessing cloud hosts, are you a IT ADMIN managing access & credentials in your corporation, are you BUSINESS MANAGER and want to save money or are you responsible of IT SECURITY in DevOps