To use the SFTP plugin, you need to connect a project to a Target. This is much like sharing a project using a team provider like CVS, except that targets don't do version control. They just do file synchronization between the workspace and a remote location.
These steps connect a project to a target site:
- Right-click on a project, then select Team -> Target Site
- Select Create new site and then SFTP. You can also select ordinary FTP or WebDAV from this dialog, but that is outside the scope of this manual.
- Complete the New Sftp site dialog. A few notes:
- Version 2 of the SSH protocol (SSH2) is the default. If you're not sure, try SSH2 first and SSH1 later if it doesn't work.
- The "path of sftp-server command" is only necessary for SSH1. Therefore it is greyed-out as
long as SSH2 is selected. If you use SSH1, verify that the sftp-server executable is
in the default location
/usr/libexec/openssh/sftp-serveron the server. If it isn't, locate it. Perhaps by
locate sftp-serverif the locate command is available. Use this location in the New Sftp site dialog.
- An empty base path indicates the home-directory of the user.
- In the next wizard page you have the option of selecting a subdirectory of the path you just entered. You can have different projects using the same Sftp Site with different subdirectories from the base Path.
- After pressing Finish, your project is connected to an Sftp target.
- You can now synchronize with the target when desired using right-click, Team -> Synchronize with Target. This works just like synchronizing with a CVS repository.
- You can also upload all locally changed files using right-click, Team -> Upload.
"Force disconnect target"
If you previously installed version 1.1.3 or earlier of the SFTP plugin, and now upgrade to version 1.2.0, you may have problems with projects that were already connected to a target. Eclipse will believe that these projects are no longer connected to a target, but when you try to connect one again, eclipse will show an error message that says that the project still is connected to a target.
The problem is in the target manager code and it can't be easily fixed in the SFTP plugin. However a
solution has been provided using a second small plugin,
org.klomp.eclipse.team.ui. This is
installed automatically when you install the SFTP plugin with the update manager.
Whenever you encounter the problem described above, open the pop-up menu on the project, go into the Team submenu and select "Force disconnect target". This will remove all traces of an earlier connection to a target from the project; after that, you can safely connect the project to a new target.