Command failed with return code 127 (or 255)

You will get the error with SCP protocol, if command necessary for facilitate operation you were trying to do does not exist on remote server or the shell cannot find it.

If you are not an experienced Unix user, you should first try using SFTP protocol instead.

If you are sure that the command exists on the remote server, make sure that WinSCP (or rather the shell) can find it. You may need to add path to the command to PATH environment variable. Also make sure that the startup script that sets PATH is actually executed for non-interactive sessions.

Advertisement

You can also try to run the respective command from terminal (with the same account that you use with WinSCP), to verify that you can execute it. You may not have sufficient permissions, or the command dependencies may not be installed.

Common situations, in which you may get the error:

  • Transferring files fails, because path to scp command is not in PATH;
  • Error appears while logging in, because your *nix distribution lacks groups command. You can instruct WinSCP not to use the command in site settings.

Last modified: by martin – Currently locked by: 107.174.235.136