6.3 Using public key authentication with PSFTP
Like PuTTY, PSFTP can authenticate using a public key instead of a password. There are three ways you can do this.
Firstly, PSFTP can use PuTTY saved sessions in place of hostnames. So you might do this:
- Run PuTTY, and create a PuTTY saved session (see section 4.1.2) which specifies your private key file (see section 4.22.8). You will probably also want to specify a username to log in as (see section 4.14.1).
-
In PSFTP, you can now use the name of the session instead of a hostname: type
psftp sessionname
, wheresessionname
is replaced by the name of your saved session.
Secondly, you can supply the name of a private key file on the command line, with the -i
option. See section 3.8.3.18 for more information.
Thirdly, PSFTP will attempt to authenticate using Pageant if Pageant is running (see chapter 9). So you would do this:
- Ensure Pageant is running, and has your private key stored in it.
- Specify a user and host name to PSFTP as normal. PSFTP will automatically detect Pageant and try to use the keys within it.
For more general information on public-key authentication, see chapter 8.