diff --git a/cyberduck/bookmarks.md b/cyberduck/bookmarks.md
index 0f29b5e7..962bc648 100644
--- a/cyberduck/bookmarks.md
+++ b/cyberduck/bookmarks.md
@@ -105,8 +105,8 @@ Select *Bookmark → Edit Bookmark (macOS `⌘E` Windows `Strg+E`)*. A panel whe
| Nickname | Any name for the bookmark describing it for easy access using the bookmark filter. You can
also type this name in the bookmark view to select it by name. |
| Server | The hostname of the server. This is not editable if you have chosen a protocol with a predefined,
non-configurable hostname. *Make sure no server path is included but only the domain name and instead set any server path in _Path_.* |
| Username | The login credentials from your service provider. |
-| SSH Private
Key | For [SFTP](../protocols/sftp/index.md) connections only. Choose a private key for public key authentication instead of a
password. If the key is password-protected, you are prompted to enter the passphrase to
decrypt the key. |
-| Client
Certificate | For [HTTPS](../protocols/webdav/index.md#mutual-tls-mtls) connections only. Choose a client certificate for mutual transport level security (TLS). |
+| SSH Private
Key | For [SFTP](../protocols/sftp/index.md) connections only. Choose a private key for public key authentication instead of a
password. If the key is password-protected, you are prompted to enter the passphrase to
decrypt the key. Select a public key file to only offer the matching
key from the SSH agent or a [smartcard](../protocols/sftp/index.md#smartcard-pkcs11-authentication). |
+| Client
Certificate | For [HTTPS](../protocols/webdav/index.md#mutual-tls-mtls) connections only. Choose a client certificate for mutual transport level security (TLS). Certificates on a
[smartcard](../protocols/webdav/index.md#client-certificate-on-smartcard) are listed after entering the PIN of the card. |
| Path | The initial working directory when connecting to the server. This must be the document root of
the webserver if you want to configure HTTP URLs ([see below](#web-url)) to work. |
| Web URL | HTTP server address |
| Download
Folder | Default location for files downloaded from this server. |
@@ -114,6 +114,7 @@ Select *Bookmark → Edit Bookmark (macOS `⌘E` Windows `Strg+E`)*. A panel whe
| Connect
Mode | For [FTP](../protocols/ftp.md) connections only. Refer to [FTP Connect Mode](../protocols/ftp.md#ftp-connect-mode). |
| Encoding | For [FTP](../protocols/ftp.md) connections only. Character encoding of filenames on the server. You can also change
the encoding used when the connection is open using *View → Text Encoding* if characters
are not displayed properly. Try `UTF-8` (the default), `ISO-8859-1`, and `Windows-1252`.
Refer to [Character Encoding](../protocols/ftp.md#character-encoding). |
| Timezone | For all protocols except [FTP](../protocols/ftp.md), timestamps are reported in [UTC](http://en.wikipedia.org/wiki/Coordinated_Universal_Time) from the server and there is no
need for configuration. All timestamps in the browser are automatically converted to the timezone
you have configured in the *System Preferences* and displayed in local time. For [FTP](../protocols/ftp.md)
however, the local timezone is assumed for timestamps in directory listings If the server
is configured with a different timezone that your Mac and returning the local time for
modification dates, there will be an offset by the timezone difference. To get the correct local
time for modification dates in the browser, you can choose the timezone of the server in the
bookmark settings. Select *Bookmark → Edit Bookmark*. |
+| Kerberos
Realm | For [SFTP](../protocols/sftp/index.md) connections only. Realm of the server for [Kerberos authentication](../tutorials/sftp_kerberos.md#kerberos-realm-per-bookmark).
Leave empty to use the realm from the Kerberos configuration or of your ticket. |
### Passwords
diff --git a/protocols/_images/Windows-Security-Prompt.png b/protocols/_images/Windows-Security-Prompt.png
index f865682c..72390909 100644
Binary files a/protocols/_images/Windows-Security-Prompt.png and b/protocols/_images/Windows-Security-Prompt.png differ
diff --git a/protocols/ftp.md b/protocols/ftp.md
index d67eb999..366a5b59 100644
--- a/protocols/ftp.md
+++ b/protocols/ftp.md
@@ -38,9 +38,9 @@ TLSv1 and TLSv1.1 are no longer supported as of
### Mutual TLS
-Mutual (two-way) TLS with a client certificate for authentication is supported. When a server requests a client certificate for authentication, a prompt is displayed to choose a certificate with a private key that matches the given issuer name requested from the server. Matching certificates are searched for in the Keychain on macOS or the Windows Certificate Manager respectively.
+Mutual (two-way) TLS with a client certificate for authentication is supported. When a server requests a client certificate for authentication and no certificate is selected in the bookmark, a prompt is displayed to choose a certificate with a private key issued by an authority accepted by the server. The prompt lists the certificates from the Keychain on macOS or the Windows Certificate Manager respectively together with the certificates on a [smartcard](webdav/index.md#client-certificate-on-smartcard).
-
+
### Switch to Secure Connection
diff --git a/protocols/profiles/index.md b/protocols/profiles/index.md
index 7e633199..5696d28f 100644
--- a/protocols/profiles/index.md
+++ b/protocols/profiles/index.md
@@ -70,6 +70,7 @@ The value of `Vendor` must be unique among all installed connection profiles.
- `Anonymous Configurable` Boolean if anonymous access is configurable.
- `Path Configurable` Boolean if default path is configurable.
- `Certificate Configurable` Boolean if client certificate is configurable.
+- `Kerberos Configurable` Boolean if the Kerberos realm is configurable in the bookmark. Defaults to `true` for [SFTP](../sftp/index.md) profiles.
- `Role Configurable`. Boolean if role is configurable. Typically an ARN referencing the AWS IAM role to assume using AWS STS API.
- `Region` Location constraint for [OpenStack Swift](../openstack/index.md) and [S3](../s3/index.md) profiles.
:::{admonition} S3
diff --git a/protocols/sftp/index.md b/protocols/sftp/index.md
index a70650e1..59666f90 100644
--- a/protocols/sftp/index.md
+++ b/protocols/sftp/index.md
@@ -9,6 +9,11 @@ providers
../../tutorials/sftp_publickeyauth_1password
../../tutorials/sftp_publickeyauth_bitwarden
../../tutorials/sftp_publickeyauth_yubikey
+../../tutorials/sftp_publickeyauth_pageant
+../../tutorials/sftp_publickeyauth_securitykey
+../../tutorials/sftp_publickeyauth_pkcs11
+../../tutorials/sftp_kerberos
+../../tutorials/sftp_azure_blob_storage
:::
:::{image} ../_images/ftp.png
@@ -32,7 +37,7 @@ If you have access to a server using a secure shell ([SSH2](http://en.wikipedia.
#### Public Key Fingerprints
-Public key fingerprints are checked against and written to `~/ssh/known_hosts` when accepted. This does not apply to the Mac App Store version which does store key fingerprints in the preferences.
+Public key fingerprints are checked against and written to `~/.ssh/known_hosts` when accepted. This does not apply to the Mac App Store version which does store key fingerprints in the preferences.
#### Configuration File
@@ -41,12 +46,19 @@ The following configuration options from `~/.ssh/config` are supported for SFTP
- *IdentityFile* for public key authentication.
- *IdentityAgent* for public key authentication. Specifies the UNIX-domain socket used to communicate with the authentication agent.
- *HostName* aliases.
+- *Port* to connect to.
- *User* preference for login credentials.
- *ProxyJump* to connect via SSH tunnel through bastion server.
-- *PreferredAuthentications* to limit authentication methods tried to login.
-- *IdentitiesOnly*. Only try explicitly set private keys to authenticate but not all identities found in SSH agent. Resolves _Too many authentication failures_ errors with servers limiting the number of attempted authentication requests.
+- *ProxyCommand* to connect through the standard input and output of a command.
+- *PreferredAuthentications* to set the order of authentication methods tried to login. Methods not listed are still tried afterwards.
+- *IdentitiesOnly*. Only try the private key set with *IdentityFile* in `~/.ssh/config` to authenticate but not all identities found in SSH agent or on a [smartcard](#smartcard-pkcs11-authentication). The key selected in the bookmark does not apply. With no *IdentityFile* set, no identity from the SSH agent or smartcard is offered. Resolves _Too many authentication failures_ errors with servers limiting the number of attempted authentication requests.
+- *Include* to read other configuration files and *Match* blocks with the criteria `host` and `user`.
+- *SecurityKeyProvider* for the middleware library signing with a [FIDO2 security key](../../tutorials/sftp_publickeyauth_securitykey.md) for `sk-ecdsa-sha2-nistp256@openssh.com` and `sk-ssh-ed25519@openssh.com` keys.
+- *PKCS11Provider* for the module reading keys from a [smartcard](../../tutorials/sftp_publickeyauth_pkcs11.md). Set to `none` to not use a smartcard for the host.
- A [bookmark](../../cyberduck/bookmarks.md) will update its public key authentication setting from the *IdentityFile* configuration in `~/.ssh/config`. Also when opening a new [connection](../../cyberduck/connection.md#toolbar-button) using *File → Open Connection…, IdentityFile* and *User* parameters in the OpenSSH user config file are auto completed.
+Arguments with spaces such as a path can be enclosed in quotes or have the space escaped with a backslash. A `#` at the start of an argument begins a comment.
+
Example `~/.ssh/config` configuration:
```
@@ -97,23 +109,88 @@ Follow the [step-by-step instructions](../../tutorials/sftp_publickeyauth.md) to
#### PuTTY Key Format Interoperability
-PuTTY private keys (`.ppk`) are supported for `rsa` key types. `ed25519` is not supported.
+PuTTY private keys (`.ppk`) are supported for `rsa`, `dsa`, `ecdsa` and `ed25519` key types.
#### OpenSSH Key Format Interoperability
-OpenSSH private keys of type `rsa`, `dsa`, `ecdsa` and `ed25519` (in OpenSSL `PEM` format) are supported. The new OpenSSH format (`openssh-key-v1`) is only supported for `ecdsa` and `ed25519`.
+OpenSSH private keys of type `rsa`, `dsa`, `ecdsa` and `ed25519` (in OpenSSL `PEM` format) are supported. The new OpenSSH format (`openssh-key-v1`) is supported for `rsa`, `ecdsa` and `ed25519` but not for `dsa`.
##### OpenSSH User Certificate Authentication
+Applies to SSH servers, which are configured with [`TrustedUserCAKeys`](https://man.openbsd.org/sshd_config#TrustedUserCAKeys), refer to your software vendor for configuration. To configure authentication with a User CA signed private key, configure the private key as described in [Configure Public Key Authentication](#public-key-authentication) step 3. The signed public key file _must_ reside next to the private key file, suffixed `-cert.pub` or `.pub`. The [`CertificateFile`](https://man.openbsd.org/ssh_config#CertificateFile) configuration directive in `~/.ssh/config` is not supported. Pay attention to the server configuration and [`PubkeyAcceptedAlgorithms`](https://man.openbsd.org/sshd_config#PubkeyAcceptedAlgorithms) specifically which determines the allowed private key algorithms to authenticate with.
+
+#### Security Key (FIDO2) Authentication
+
:::{important}
-* Cyberduck [8.9.0](https://cyberduck.io/changelog/) or later required
-* Mountain Duck [4.16.0](https://mountainduck.io/changelog/) or later required
+* Cyberduck [9.7.0](https://cyberduck.io/changelog/) or later required
:::
-Applies to SSH servers, which are configured with [`TrustedUserCAKeys`](https://man.openbsd.org/sshd_config#TrustedUserCAKeys), refer to your software vendor for configuration. To configure authentication with a User CA signed private key, configure the private key as described in [Configure Public Key Authentication](#public-key-authentication) step 3. The signed public key file _must_ reside next to the private key file, suffixed `-cert.pub` or `.pub`. The [`CertificateFile`](https://man.openbsd.org/ssh_config#CertificateFile) configuration directive in `~/.ssh/config` is not supported. Pay attention to the server configuration and [`PubkeyAcceptedAlgorithms`](https://man.openbsd.org/sshd_config#PubkeyAcceptedAlgorithms) specifically which determines the allowed private key algorithms to authenticate with.
+Keys of type `sk-ecdsa-sha2-nistp256@openssh.com` and `sk-ssh-ed25519@openssh.com` created with `ssh-keygen -t ecdsa-sk` respectively `ssh-keygen -t ed25519-sk` are supported. The private key of such a key never leaves the authenticator, which is either the Secure Enclave of a Mac unlocked with _Touch ID_ or a hardware token such as a _YubiKey_ touched to confirm. The key file selected in the [Bookmark](../../cyberduck/bookmarks.md) holds the credential handle only.
+
+Signing a login is delegated to the middleware library of the authenticator, set with the [`SecurityKeyProvider`](#configuration-file) directive in `~/.ssh/config`, the `SSH_SK_PROVIDER` environment variable or the [hidden configuration option](../../tutorials/hidden_properties.md) `ssh.authentication.securitykey.provider`. A value of the configuration directive beginning with `$` is read from the environment variable of that name. The value `internal` selecting the support built into OpenSSH is ignored. It defaults to `/usr/lib/ssh-keychain.dylib` for keys in the Secure Enclave on macOS. There is no default on Linux, where OpenSSH talks to a token with built-in USB HID support instead of a library that could be loaded. Add the key to an [SSH agent](#public-key-authentication-using-ssh-agent) there, which prompts to confirm the login and works with any token supported by OpenSSH, or set the directive or option to a middleware library for the token. Loading a middleware library is not supported on Windows, where the key must be added to an SSH agent.
+
+:::{important}
+The server must run _OpenSSH 8.2_ or later. Earlier versions do not know the `sk-*` key types and ignore the entry in `authorized_keys`.
+:::
+
+:::{admonition} Tutorial
+:class: tip
+
+Follow the [step-by-step instructions](../../tutorials/sftp_publickeyauth_securitykey.md) to create a key in the Secure Enclave or on a hardware token and connect with it.
+:::
+
+#### Smartcard (PKCS#11) Authentication
+
+:::{important}
+* Cyberduck [9.7.0](https://cyberduck.io/changelog/) or later required
+:::
+
+Private keys kept on a smartcard or a hardware token such as a _YubiKey_ with the _PIV_ application are read with the _PKCS#11_ module of the card, the equivalent of `ssh -I`. Every key on the card with a matching certificate is offered to the server in turn and the PIN is prompted for when required by the card. There is no prompt to choose a key. A key on a card without a certificate is not found. When more than one card is connected, only the first one found is used.
+
+:::::{tabs}
+::::{group-tab} macOS
+
+The _OpenSC_ module bundled with the application is used by default and a supported card is found with no further configuration. Set a different module with the [`PKCS11Provider`](#configuration-file) directive in `~/.ssh/config` or the [hidden configuration option](../../tutorials/hidden_properties.md) `connection.keystore.pkcs11.library` to the absolute path of the module.
+
+:::{note}
+The module `/usr/lib/ssh-keychain.dylib` included with macOS for smartcards paired with `sc_auth` can only be loaded by `ssh` and is not supported. Use the bundled _OpenSC_ module or the module from the vendor of the card instead.
+:::
+
+::::
+::::{group-tab} Windows
+
+No module is bundled with the application and no card is used with the default configuration. Install the module for your card such as [OpenSC](https://github.com/OpenSC/OpenSC/releases) for Windows (64-bit) and set the [hidden configuration option](../../tutorials/hidden_properties.md) `connection.keystore.pkcs11.library` to the path of the module. Write the path with forward slashes.
+
+```
+connection.keystore.pkcs11.library=C:/Program Files/OpenSC Project/OpenSC/pkcs11/opensc-pkcs11.dll
+```
+
+:::{note}
+A card connected to the Windows computer is not available in a _Remote Desktop_ session. Connect the card to the computer running the Remote Desktop client instead and enable the redirection of smart cards.
+:::
+
+::::
+:::::
+
+Keys on the card are attempted after the identities from the [SSH agent](#public-key-authentication-using-ssh-agent) and before the private key file selected in the bookmark. When a password is saved for the bookmark, password authentication is attempted first.
+
+- When a public key file is selected for _SSH Private Key_ in the [bookmark](../../cyberduck/bookmarks.md#edit-bookmark), only the matching key on the card is offered. No key is offered when none matches.
+- When a private key file is selected in the bookmark, the card is not used and there is no prompt for the PIN.
+- With [`IdentitiesOnly`](#configuration-file) in `~/.ssh/config`, only the key matching the public key file set with *IdentityFile* is offered. The card is not used when *IdentityFile* is missing or set to a private key file.
+- When the prompt for the PIN is canceled, the card is skipped and the login continues with the next authentication method.
+
+The option `connection.keystore.pkcs11.library` also sets the module used to read a [client certificate](../webdav/index.md#client-certificate-on-smartcard) from a smartcard.
+
+To not use a smartcard for a host, set `PKCS11Provider none` in `~/.ssh/config`. Set the [hidden configuration option](../../tutorials/hidden_properties.md) `ssh.authentication.pkcs11.enable` to `false` to disable authentication with a smartcard for all connections.
+
+:::{admonition} Tutorial
+:class: tip
+
+Follow the [step-by-step instructions](../../tutorials/sftp_publickeyauth_pkcs11.md) to authenticate with a key on a smartcard.
+:::
#### Public Key Authentication Using SSH Agent
-When connecting to a SSH server, Cyberduck will lookup matching private keys from the SSH agent when attempting to authenticate with the server if no password is available and no explicit private key to use is configured in the bookmark.
+When connecting to a SSH server, Cyberduck will try the identities from the SSH agent to authenticate with the server. When a password is saved for the bookmark, password authentication is attempted first. When a private or public key is selected in the bookmark, only the identity in the agent matching this key is offered. If no identity matches, all identities are offered. Disable the use of the SSH agent with the [hidden configuration option](../../tutorials/hidden_properties.md) `ssh.authentication.agent.enable=false`.
:::{admonition} Mac App Store
:class: attention
@@ -146,14 +223,10 @@ Host myhostname
IdentityAgent ~/.bitwarden-ssh-agent.sock
```
-
:::
:::{group-tab} Windows
-The following agents are supported:
- * [Pageant](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html). Refer to [How To Use Pageant to Streamline SSH Key Authentication with PuTTY](https://www.digitalocean.com/community/tutorials/how-to-use-pageant-to-streamline-ssh-key-authentication-with-putty).
- * OpenSSH for Windows using the pipe (`\\.\pipe\openssh-ssh-agent`) by default. Use `IdentityAgent` to set a custom socket path for any other compatible agent if needed.
- * [1Password SSH agent](https://developer.1password.com/docs/ssh/agent/compatibility/#cyberduck)
+SSH agents that provide a named pipe are supported, such as the OpenSSH agent, the [1Password SSH agent](https://developer.1password.com/docs/ssh/agent/compatibility/#cyberduck) and [Pageant](../../tutorials/sftp_publickeyauth_pageant.md). The OpenSSH agent pipe (`\\.\pipe\openssh-ssh-agent`) is used by default. Use `IdentityAgent` to set a different pipe if needed.
:::
::::
@@ -175,6 +248,24 @@ Host myhostname
Alternatively you can select the public key file in the [bookmark](../../cyberduck/bookmarks.md#edit-bookmark) configuration.
+### Kerberos (GSSAPI) Authentication
+
+:::{important}
+* Cyberduck [9.6.0](https://cyberduck.io/changelog/) or later required
+:::
+
+Authentication with the method `gssapi-with-mic` using a _Kerberos_ ticket obtained with `kinit` is supported. The method is attempted after public key authentication and before prompting for a password when no password is saved for the bookmark. Without a valid ticket the login continues with the next authentication method. Connect using the fully qualified hostname matching the service principal of the server.
+
+The Kerberos configuration is read from the default location such as `/etc/krb5.conf`. Without a configuration, the realm of the server is assumed to be the realm of your ticket and the KDC is looked up from DNS. On Windows, the ticket is read from [MIT Kerberos for Windows](https://web.mit.edu/kerberos/dist/) when installed. Disable Kerberos authentication with the [hidden configuration option](../../tutorials/hidden_properties.md) `ssh.authentication.gssapi.enable` set to `false`.
+
+Set the realm of the server in _Kerberos Realm_ of the [bookmark](../../cyberduck/bookmarks.md#bookmark-options) when the server belongs to a different realm than your ticket.
+
+:::{admonition} Tutorial
+:class: tip
+
+Follow the [step-by-step instructions](../../tutorials/sftp_kerberos.md) to authenticate with a Kerberos ticket.
+:::
+
### One-Time Passcodes (2FA)
Using a challenge-response authentication with one-time password generators such as [*DUO*](https://duo.com/product/multi-factor-authentication-mfa), [*SecurID*](https://www.rsa.com/products/securid/) or [*Google Authenticator*](https://github.com/google/google-authenticator) is supported. After the initial login prompt for the username and password, a second login prompt is displayed to enter the one-time passcode.
@@ -254,7 +345,7 @@ Use *View → Customize Toolbar...* to add the *Terminal.app* toolbar icon to yo
You can change the SSH command using the [hidden configuration option](../../tutorials/hidden_properties.md)
```
-terminal.command.ssh=\"ssh\ -t\ {0}\ {1}@{2}\ -p\ {3}\ \\\"cd\ {4}\ \&\&\ exec\ \\\\\$SHELL\\\"\"
+terminal.command.ssh=\"ssh\ -t\ {0}\ {1}@{2}\ -p\ {3}\ \\\"cd\ {4}\ \&\&\ exec\ \\\\\$SHELL\ -l\\\"\"
```
where
@@ -265,7 +356,7 @@ where
- {3} is the port number of the remote host
- {4} is the current working directory in the browser
-Because of all the escaping of characters, it might be easier to edit the key using *Property List Editor* if you have the developer tools installed. You can then set the string for the key `terminal.command.ssh to ssh -t {0} {1}@{2} -p {3} "cd {4} && exec \$SHELL"`. Test the string in *Terminal.app* first if it is valid.
+Because of all the escaping of characters, it might be easier to edit the key using *Property List Editor* if you have the developer tools installed. You can then set the string for the key `terminal.command.ssh` to `ssh -t {0} {1}@{2} -p {3} "cd {4} && exec \$SHELL -l"`. Test the string in *Terminal.app* first if it is valid.
**Using [iTerm2](https://www.iterm2.com/)**
@@ -364,11 +455,11 @@ You can set Cyberduck or a third-party application as the default application (p
### Key Exchange
-`diffie-hellman-group1-sha1`, `diffie-hellman-group14-sha1`, `diffie-hellman-group14-sha256`, `diffie-hellman-group15-sha512`, `diffie-hellman-group16-sha512`, `diffie-hellman-group17-sha512`, `diffie-hellman-group18-sha512 diffie-hellman-group-exchange-sha1`, `diffie-hellman-group-exchange-sha256`, `ecdh-sha2-nistp256`, `ecdh-sha2-nistp384`, `ecdh-sha2-nistp521`, `curve25519-sha256@libssh.org`
+`curve25519-sha256`, `curve25519-sha256@libssh.org`, `diffie-hellman-group-exchange-sha256`, `ecdh-sha2-nistp521`, `ecdh-sha2-nistp384`, `ecdh-sha2-nistp256`, `diffie-hellman-group-exchange-sha1`, `diffie-hellman-group1-sha1`, `diffie-hellman-group14-sha1`, `diffie-hellman-group14-sha256`, `diffie-hellman-group15-sha512`, `diffie-hellman-group16-sha512`, `diffie-hellman-group17-sha512`, `diffie-hellman-group18-sha512`, `diffie-hellman-group14-sha256@ssh.com`, `diffie-hellman-group15-sha256`, `diffie-hellman-group15-sha256@ssh.com`, `diffie-hellman-group15-sha384@ssh.com`, `diffie-hellman-group16-sha256`, `diffie-hellman-group16-sha384@ssh.com`, `diffie-hellman-group16-sha512@ssh.com`, `diffie-hellman-group18-sha512@ssh.com`
### SSH Key Types
-`ssh-rsa`, `ssh-dss`, `ecdsa-sha2-nistp256`, `ecdsa-sha2-nistp384`, `ecdsa-sha2-nistp521`, `ssh-ed25519`, `rsa-sha2-256`, `rsa-sha2-512`
+`ssh-rsa`, `ssh-dss`, `ecdsa-sha2-nistp256`, `ecdsa-sha2-nistp384`, `ecdsa-sha2-nistp521`, `ssh-ed25519`, `rsa-sha2-256`, `rsa-sha2-512`, `sk-ecdsa-sha2-nistp256@openssh.com`, `sk-ssh-ed25519@openssh.com`
### SSH Certificate Key Types
@@ -380,7 +471,7 @@ Compression with `zlib` and `zlib@openssh.com` is supported.
### Private Key Files
-`pkcs5`, `pkcs8`, `openssh-key-v1`
+`pkcs5`, `pkcs8`, `openssh-key-v1`, PuTTY `.ppk`
## Incompatibilities
@@ -392,14 +483,14 @@ Serv-U MFT does not fully implement SFTPv3. Files cannot be created, renamed, up
### Too Many Authentication Failures
-Running an SSH agent with many added identities can lead to the server error _Too many authentication failures_ when trying to authenticate with all available identities.
+Running an SSH agent with many added identities or using a [smartcard](#smartcard-pkcs11-authentication) holding several keys can lead to the server error _Too many authentication failures_ when trying to authenticate with all available identities.
- Select the identity in the [bookmark](../../cyberduck/bookmarks.md#edit-bookmark) with _SSH Private Key_.
- Increase the allowed authentication tries on the *server* by adjusting [`MaxAuthTries`](https://man.openbsd.org/sshd_config.5#MaxAuthTries).
Possible remedies using configuration in [OpenSSH configuration file](#openssh-configuration-interoperability):
-- [`IdentitiesOnly`](https://man.openbsd.org/ssh_config.5#IdentitiesOnly) in client configuration file `~/.ssh/config`. Only try to authenticate with explicitly set private key instead of all identities retrieved from SSH agent.
-- Set [`PreferredAuthentications`](https://man.openbsd.org/ssh_config.5#PreferredAuthentications) in client configuration file `~/.ssh/config` to disable public key authentication for example.
+- [`IdentitiesOnly`](https://man.openbsd.org/ssh_config.5#IdentitiesOnly) in client configuration file `~/.ssh/config`. Only try to authenticate with explicitly set private key instead of all identities retrieved from SSH agent or smartcard.
+- Set [`PreferredAuthentications`](https://man.openbsd.org/ssh_config.5#PreferredAuthentications) in client configuration file `~/.ssh/config` to try another method such as `password` before public key authentication. Methods not listed are still tried afterwards.
### Illegal SFTP Packet Length: `Invalid packet: indicated length 1114795883 too large`
diff --git a/protocols/webdav/_images/Windows-Security-Prompt.png b/protocols/webdav/_images/Windows-Security-Prompt.png
index f865682c..72390909 100644
Binary files a/protocols/webdav/_images/Windows-Security-Prompt.png and b/protocols/webdav/_images/Windows-Security-Prompt.png differ
diff --git a/protocols/webdav/index.md b/protocols/webdav/index.md
index b770a67d..70b8a17b 100644
--- a/protocols/webdav/index.md
+++ b/protocols/webdav/index.md
@@ -60,18 +60,104 @@ Mutual (two-way) TLS with a client certificate for authentication is supported.
#### Prompt to Authenticate with Certificate When Negotiating Secure (TLS) Connection
-When a server requests a client certificate for authentication, a prompt is displayed to choose a certificate with a
-private key that matches the given issuer name requested from the server. Matching certificates are searched for in the
-*Keychain* on macOS or the *Windows Certificate Manager* respectively.
+When a server requests a client certificate for authentication and no certificate is selected in the bookmark, a prompt
+is displayed to choose a certificate with a private key issued by an authority accepted by the server. The prompt lists
+the certificates from the *Keychain* on macOS or the *Windows Certificate Manager* respectively together with the
+certificates on a [smartcard](#client-certificate-on-smartcard). The chosen certificate is saved in the bookmark.
-
+
#### Select Client Certificate in Bookmark
-You can also preselect a certificate to use for authentication when editing the bookmark.
+You can also preselect a certificate to use for authentication when editing the bookmark. Certificates on a
+[smartcard](#client-certificate-on-smartcard) are listed as well.

+#### Client Certificate on Smartcard
+
+:::{important}
+* Cyberduck [9.7.0](https://cyberduck.io/changelog/) or later required
+:::
+
+A certificate with its private key on a smartcard or a hardware token such as a _YubiKey_ with the _PIV_ application can be
+used for authentication. The private key never leaves the card, which signs the TLS handshake after the PIN is entered.
+The certificates on the card are read with the _PKCS#11_ module set with the
+[hidden configuration option](../../tutorials/hidden_properties.md) `connection.keystore.pkcs11.library` and listed
+together with the certificates from the *Keychain* or the *Windows Certificate Manager* in the prompt when connecting and
+in *Client Certificate* when editing the bookmark.
+
+- You are prompted for the PIN of the card to read its certificates. The PIN is requested once and the card remains
+ unlocked until you quit the application. When the prompt for the PIN is canceled, only the certificates from the
+ *Keychain* or the *Windows Certificate Manager* are listed.
+- With a card inserted, opening a bookmark with the option to select a client certificate prompts for the PIN to list
+ the certificates on the card.
+- A certificate available from both the card and the *Keychain* or the *Windows Certificate Manager* is listed once.
+- The same option sets the module used for
+ [public key authentication with a smartcard](../sftp/index.md#smartcard-pkcs11-authentication) for SFTP connections.
+
+:::::{tabs}
+::::{group-tab} macOS
+
+A smartcard is not available in the *Keychain*. The card is read with the _OpenSC_ _PKCS#11_ module bundled with the
+application by default and a supported card is found with no further configuration. To use the module from the vendor of
+your card instead, set `connection.keystore.pkcs11.library` to the absolute path of the module.
+
+:::{note}
+With _OpenSC_, a certificate is listed with the name of its slot on the card such as *Certificate for PIV Authentication*
+instead of the subject of the certificate.
+:::
+
+:::{note}
+The module `/usr/lib/ssh-keychain.dylib` included with macOS for smartcards paired with `sc_auth` can only be loaded by
+`ssh` and is not supported.
+:::
+
+::::
+::::{group-tab} Windows
+
+A certificate on a smartcard is available in two ways, which can be combined.
+
+- **Windows Certificate Manager:** With the driver of the card installed, Windows copies the certificates on the card to
+ the personal certificate store of the user when the card is inserted. They are listed with no configuration in the
+ application and Windows prompts for the PIN of the card when signing. With the driver for _PIV_ cards included with
+ Windows, only the certificate for _PIV Authentication_ in slot 9a is available.
+- **_PKCS#11_ module:** No module is bundled with the application and none is used by default. Install the module for
+ your card such as [OpenSC](https://github.com/OpenSC/OpenSC/releases) for Windows (64-bit) and set
+ `connection.keystore.pkcs11.library` to the path of the module, written with forward slashes. All certificates on the
+ card are then listed, such as certificates with an EC key in other slots, and the application prompts for the PIN.
+ ```
+ connection.keystore.pkcs11.library=C:/Program Files/OpenSC Project/OpenSC/pkcs11/opensc-pkcs11.dll
+ ```
+
+When a certificate is available both ways, the card read with the module is used to sign and the PIN is only requested
+once.
+
+:::{note}
+When a certificate on the card is not listed with no module set, verify it is displayed in *Personal → Certificates* of
+the *Windows Certificate Manager* (`certmgr.msc`) with the card inserted. If missing, install the driver from the vendor
+of the card.
+:::
+
+:::{note}
+A card connected to the Windows computer is not available in a _Remote Desktop_ session. Connect the card to the
+computer running the Remote Desktop client instead and enable the redirection of smart cards.
+:::
+
+::::
+:::::
+
+:::{tip}
+Select *Anonymous Login* in the bookmark when the server does not require a username and password in addition to the
+certificate. You are prompted for login credentials before connecting otherwise.
+:::
+
+:::{note}
+When the prompt to choose a certificate is canceled, no certificate is sent and you are not asked again for the bookmark.
+Select the certificate in *Client Certificate* of the bookmark to use it. With a certificate from a smartcard selected in
+the bookmark, you are prompted for the PIN when connecting.
+:::
+
### Trust Certificate
If the certificate is not trusted by the system, you are asked to make an exception if you still want to connect to the
diff --git a/tutorials/index.md b/tutorials/index.md
index f5b267ec..7c30c757 100644
--- a/tutorials/index.md
+++ b/tutorials/index.md
@@ -17,10 +17,14 @@ owncloud_opencloud_oidc
iam
vault_localdisk
sftp_publickeyauth
+sftp_publickeyauth_securitykey
+sftp_publickeyauth_pkcs11
sftp_publickeyauth_1password
sftp_publickeyauth_bitwarden
sftp_publickeyauth_yubikey
sftp_azure_blob_storage
+sftp_publickeyauth_pageant
+sftp_kerberos
cli_github_action
:::
@@ -65,6 +69,12 @@ Both [Cyberduck](../cyberduck/index.md) and [Mountain Duck](../mountainduck/inde
## [Configure Public Key Authentication for SFTP](sftp_publickeyauth.md)
Configure Public Key Authentication for SFTP using OpenSSH tools.
+### [Use a FIDO2 Security Key](sftp_publickeyauth_securitykey.md)
+Authenticate with a `sk-*` key in the Secure Enclave unlocked with Touch ID or on a hardware token such as a YubiKey.
+
+### [Use a PKCS#11 Smartcard](sftp_publickeyauth_pkcs11.md)
+Authenticate with a private key kept on a smartcard read with a PKCS#11 module such as OpenSC.
+
### [Configure 1Password SSH Agent](sftp_publickeyauth_1password.md)
Authenticate with SSH private key saved in 1Password.
@@ -77,5 +87,11 @@ Authenticate with SSH private key saved on YubiKey.
## [Connect to Azure Blob Storage with SFTP](sftp_azure_blob_storage.md)
Authenticate with a local user using a password or private key, or with an SSH certificate issued by Microsoft Entra ID.
+### [Configure Pageant](sftp_publickeyauth_pageant.md)
+Authenticate with SSH private key loaded in Pageant.
+
+## [Configure Kerberos Authentication for SFTP](sftp_kerberos.md)
+Authenticate with a Kerberos ticket obtained with `kinit` using GSSAPI.
+
## [Use Cyberduck CLI GitHub Action](cli_github_action.md)
Use Cyberduck CLI Docker Container in GitHub Actions
\ No newline at end of file
diff --git a/tutorials/sftp_kerberos.md b/tutorials/sftp_kerberos.md
new file mode 100644
index 00000000..990006f3
--- /dev/null
+++ b/tutorials/sftp_kerberos.md
@@ -0,0 +1,172 @@
+Configure Kerberos Authentication for SFTP
+====
+
+> Authentication with _Kerberos_ allows you to connect to a remote server without a password using the ticket you already obtained when logging in to your organization's realm with `kinit` or with your account on the Mac. The ticket is presented to the server using the SSH authentication method `gssapi-with-mic`, the equivalent of `ssh -o GSSAPIAuthentication=yes`.
+
+:::{important}
+* Cyberduck [9.7.0](https://cyberduck.io/changelog/) or later required
+* Mountain Duck [6.0.0](https://mountainduck.io/changelog/) or later required
+:::
+
+Authentication with Kerberos is attempted after public key authentication and before prompting for a password when no password is saved for the bookmark. Without a valid ticket the method is skipped and the login continues with the next authentication method offered by the server. Kerberos authentication can be [disabled](#kerberos-configuration) with the hidden configuration option `ssh.authentication.gssapi.enable`.
+
+## Requirements
+
+- The server running OpenSSH is configured with `GSSAPIAuthentication yes` in `sshd_config` and has a keytab with the service principal `host/server.example.com@EXAMPLE.COM` for its fully qualified hostname. Refer to your administrator.
+- Your principal such as `user@EXAMPLE.COM` is allowed to log in to the account on the server. By default the principal `user@EXAMPLE.COM` maps to the account `user`. Additional principals are listed in `~/.k5login` of the account on the server.
+- The Key Distribution Center (KDC) of the realm of the server is found in the [Kerberos configuration](#kerberos-configuration) or can be looked up in DNS. The realm of the server is determined from the Kerberos configuration, the [realm in the bookmark](#kerberos-realm-per-bookmark) or else is assumed to be the realm of your ticket.
+- On Windows, [MIT Kerberos for Windows](https://web.mit.edu/kerberos/dist/) is installed to obtain the ticket.
+
+## Setup
+
+:::::{tabs}
+::::{group-tab} macOS
+
+1. Obtain a ticket for your principal. Enter the password of your Kerberos account when prompted.
+ ```
+ kinit user@EXAMPLE.COM
+ ```
+
+ :::{tip}
+ Tickets obtained with _Ticket Viewer.app_ in `/System/Library/CoreServices/Applications` or when logging in to a Mac bound to a directory service with Kerberos are used as well.
+ :::
+
+2. Verify a ticket for the realm is listed and has not expired.
+ ```
+ klist
+ ```
+
+3. Verify the setup with OpenSSH before connecting with Cyberduck. Use the fully qualified hostname of the server.
+ ```
+ ssh -o GSSAPIAuthentication=yes -o PreferredAuthentications=gssapi-with-mic user@server.example.com
+ ```
+
+ A service ticket for `host/server.example.com@EXAMPLE.COM` is now listed with `klist`.
+
+4. Add a new [Bookmark](../cyberduck/bookmarks.md) in Cyberduck or Mountain Duck. Enter the fully qualified hostname `server.example.com` in _Server_ and your account in _Username_. You do **not** need to set a value for _Password_ or select a _SSH Private Key_.
+
+ :::{warning}
+ The hostname must match the service principal in the keytab of the server. Connecting using an IP address or a short hostname may fail when it cannot be resolved to the fully qualified name.
+ :::
+
+5. Optionally enter the realm such as `EXAMPLE.COM` in _Kerberos Realm_ in the _More Options_ tab of the bookmark when the server belongs to a [different realm](#kerberos-realm-per-bookmark) than your ticket.
+
+6. Connect to the server. No prompt is displayed when the ticket is accepted.
+
+::::
+::::{group-tab} Windows
+
+The ticket of _MIT Kerberos for Windows_ is kept in memory by its credentials cache server and cannot be read directly. When MIT Kerberos for Windows is installed, the ticket granting ticket is copied to a temporary credentials cache file for the login using the `klist.exe` and `kcpytkt.exe` tools of MIT Kerberos for Windows. The temporary file is deleted afterwards.
+
+1. Install [MIT Kerberos for Windows](https://web.mit.edu/kerberos/dist/) in the default location. The tools are only looked up in `MIT\Kerberos\bin` of the _Program Files_ folders `%ProgramW6432%`, `%ProgramFiles%` and `%ProgramFiles(x86)%`.
+
+2. Obtain a ticket for your principal with _MIT Kerberos Ticket Manager_ or from the command line. Enter the password of your Kerberos account when prompted.
+ ```
+ "%ProgramFiles%\MIT\Kerberos\bin\kinit.exe" user@EXAMPLE.COM
+ ```
+
+3. Verify a ticket for the realm is listed and has not expired.
+ ```
+ "%ProgramFiles%\MIT\Kerberos\bin\klist.exe"
+ ```
+
+4. Add a new [Bookmark](../cyberduck/bookmarks.md). Enter the fully qualified hostname `server.example.com` in _Server_ and your account in _Username_. You do **not** need to set a value for _Password_ or select a _SSH Private Key_.
+
+ :::{warning}
+ The hostname must match the service principal in the keytab of the server. Connecting using an IP address or a short hostname may fail when it cannot be resolved to the fully qualified name.
+ :::
+
+5. Optionally enter the realm such as `EXAMPLE.COM` in _Kerberos Realm_ when the server belongs to a [different realm](#kerberos-realm-per-bookmark) than your ticket. The configuration `krb5.ini` of MIT Kerberos for Windows in `%ProgramData%\MIT\Kerberos5` is not read.
+
+6. Connect to the server. No prompt is displayed when the ticket is accepted.
+
+::::
+:::::
+
+## Kerberos Realm per Bookmark
+
+The service principal of the server such as `host/server.example.com@EXAMPLE.COM` is composed from the hostname and the realm of the server. The realm is determined in the following order.
+
+1. The realm set in _Kerberos Realm_ of the [bookmark](../cyberduck/bookmarks.md#bookmark-options). The field is found in the _More Options_ tab on macOS.
+2. The realm the hostname is mapped to in `[domain_realm]` or else the `default_realm` of the [Kerberos configuration](#kerberos-configuration).
+3. The realm of your ticket such as `EXAMPLE.COM` for the principal `user@EXAMPLE.COM`.
+
+Set the realm in the bookmark when the server belongs to a different realm than your ticket and no Kerberos configuration maps the hostname to it. The KDC of the realm is looked up in `[realms]` of the Kerberos configuration or from DNS SRV records. The realm only applies to this connection and the Kerberos configuration is not changed.
+
+The realm is saved in the bookmark as the property `ssh.authentication.gssapi.realm` and can also be set in a [`.duck` bookmark file](hidden_properties.md#in-duck-bookmark-files).
+
+## Kerberos Configuration
+
+A Kerberos configuration is optional when the realm of the server matches the realm of your ticket and the KDC can be looked up from DNS SRV records. The Kerberos configuration is read from
+
+- macOS: `~/Library/Preferences/edu.mit.Kerberos`, `/Library/Preferences/edu.mit.Kerberos` or `/etc/krb5.conf`
+- Linux: `/etc/krb5.conf`
+- Windows: `krb5.ini` in the Windows directory such as `C:\Windows\krb5.ini`
+
+A minimal configuration for the realm `EXAMPLE.COM` looks like
+```
+[libdefaults]
+ default_realm = EXAMPLE.COM
+
+[realms]
+ EXAMPLE.COM = {
+ kdc = kdc.example.com
+ }
+
+[domain_realm]
+ .example.com = EXAMPLE.COM
+```
+
+Omit the `[realms]` section and add `dns_lookup_kdc = true` to `[libdefaults]` to look up the KDC from `_kerberos._tcp` and `_kerberos._udp` DNS SRV records of the realm instead.
+
+The following [hidden configuration options](hidden_properties.md) can be set for all connections or for a single bookmark.
+
+| Option | Description |
+|-------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `ssh.authentication.gssapi.enable` | Set to `false` to disable Kerberos authentication. Defaults to `true`. |
+| `ssh.authentication.gssapi.ticketcache` | Path to a credentials cache file to read the ticket from instead of the default cache. Obtain a ticket written to the file with `kinit -c /path/to/file user@EXAMPLE.COM`. |
+| `ssh.authentication.gssapi.realm` | Realm of the server set with _Kerberos Realm_ in the bookmark. Refer to [Kerberos Realm per Bookmark](#kerberos-realm-per-bookmark). |
+| `ssh.authentication.gssapi.mit` | Windows only. Set to `false` to not copy the ticket from the credentials cache of MIT Kerberos for Windows. Defaults to `true`. Has no effect when MIT Kerberos for Windows is not installed. |
+
+Example to disable Kerberos authentication for Cyberduck on macOS.
+```
+defaults write ch.sudo.cyberduck ssh.authentication.gssapi.enable false
+```
+
+## Connection Profiles
+
+The _Kerberos Realm_ field is shown in the bookmark for SFTP connections. Hide it for a [connection profile](../protocols/profiles/index.md) based on SFTP by setting `Kerberos Configurable` to `false`.
+
+## Require Public Key and Kerberos Authentication
+
+Servers can require authentication with both a private key and a Kerberos ticket with `AuthenticationMethods publickey,gssapi-with-mic` in `sshd_config`. Select the private key in _SSH Private Key_ of the bookmark. After the key has been accepted, login completes with the Kerberos ticket.
+
+## Troubleshooting
+
+:::{warning}
+When you are prompted for a password instead, no ticket was found or the server did not accept it. Verify with `klist` that the ticket for the realm has not expired and obtain a new ticket with `kinit` otherwise. Verify the login with `ssh -v -o GSSAPIAuthentication=yes user@server.example.com` which prints the reason why the method failed.
+:::
+
+:::{warning}
+The message _Server not found in Kerberos database_ printed by `ssh -v` indicates no service principal matches the hostname used to connect. Connect using the fully qualified hostname matching the keytab of the server.
+:::
+
+:::{warning}
+Authentication fails when the clock of your computer differs by more than five minutes from the KDC or the server. Enable _Set time and date automatically_ in _System Settings → General → Date & Time_.
+:::
+
+:::{warning}
+On Windows, when you are prompted for a password, verify `klist.exe` of MIT Kerberos for Windows lists a ticket granting ticket `krbtgt/EXAMPLE.COM@EXAMPLE.COM` for your realm. MIT Kerberos for Windows installed in a folder other than `MIT\Kerberos\bin` in _Program Files_ is not found.
+:::
+
+:::{note}
+The `GSSAPIAuthentication` directive in `~/.ssh/config` is not required. The authentication method is always attempted when offered by the server. Change the order in which methods are tried with [`PreferredAuthentications`](../protocols/sftp/index.md#configuration-file) instead. Methods not listed are still tried afterwards.
+:::
+
+## References
+
+- [`GSSAPIAuthentication` in ssh_config](https://man.openbsd.org/ssh_config#GSSAPIAuthentication)
+- [`GSSAPIAuthentication` in sshd_config](https://man.openbsd.org/sshd_config#GSSAPIAuthentication)
+- [RFC 4462: GSS-API Authentication and Key Exchange for SSH](https://www.rfc-editor.org/rfc/rfc4462)
+- [MIT Kerberos: krb5.conf](https://web.mit.edu/kerberos/krb5-latest/doc/admin/conf_files/krb5_conf.html)
+- [Java Kerberos Requirements](https://docs.oracle.com/en/java/javase/21/security/kerberos-requirements1.html) for the lookup of the configuration file.
diff --git a/tutorials/sftp_publickeyauth_pageant.md b/tutorials/sftp_publickeyauth_pageant.md
new file mode 100644
index 00000000..75468ecf
--- /dev/null
+++ b/tutorials/sftp_publickeyauth_pageant.md
@@ -0,0 +1,49 @@
+Configure Public Key Authentication for SFTP using Pageant
+====
+
+> Public-key authentication using _Pageant_ SSH Agent allows you to connect to a remote server without a password. Instead of passwords, you use a pair of keys (private and public) for authentication. The private key is kept secret, while the public key is shared with the server.
+
+:::{important}
+* Cyberduck [9.6](https://cyberduck.io/changelog/) or later required
+* PuTTY/Pageant [0.77](https://www.chiark.greenend.org.uk/~sgtatham/putty/changes.html) or later required
+
+The previous built-in Pageant integration has been removed in Cyberduck 9.6. Refer to [#18479](https://github.com/iterate-ch/cyberduck/issues/18479).
+:::
+
+Refer to [How To Use Pageant to Streamline SSH Key Authentication with PuTTY](https://www.digitalocean.com/community/tutorials/how-to-use-pageant-to-streamline-ssh-key-authentication-with-putty) for general usage of Pageant. Pageant supports writing the `IdentityAgent`-option into an OpenSSH configuration file on startup.
+
+1. Install [PuTTY](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html), which includes _Pageant_ and _PuTTYgen_.
+
+2. Start Pageant with the `--openssh-config` option, e.g. in the shortcut used to launch Pageant at login. Private key files to load can be appended to the command line.
+
+ ```
+ pageant.exe --openssh-config %USERPROFILE%\.ssh\pageant.conf
+ ```
+
+3. Add an `Include` directive at the top of `%USERPROFILE%\.ssh\config` before any `Host` entry to apply it to all hosts.
+
+ ```
+ Include ~/.ssh/pageant.conf
+ ```
+
+4. Open your private key in _PuTTYgen_ and copy the public key shown in _Public key for pasting into OpenSSH authorized_keys file_. Add it to the `authorized_keys` in your `~/.ssh` directory on the server running OpenSSH.
+
+5. Add a new [Bookmark](../cyberduck/bookmarks.md) in Cyberduck. Enter the alias from your OpenSSH configuration or the hostname in _Server_. You do **not** need to set a value for _Password_.
+
+ :::{tip}
+ The server may respond with _[Too many authentication failures](../protocols/sftp/index.md#too-many-authentication-failures)_ when trying to authenticate with all keys loaded in _Pageant_. In the [Bookmark](../cyberduck/bookmarks.md) panel, select the public key corresponding to your private key loaded in _Pageant_ for *SSH Private Key*. The public key must be available as a file, e.g. saved from _PuTTYgen_ to `%USERPROFILE%\.ssh\mykey.pub`.
+
+ Alternatively, add the public key to the OpenSSH configuration file `~/.ssh/config` with the `IdentityFile` directive
+
+ ```
+ # Public Key File used to filter identities from SSH agent
+ IdentityFile ~/.ssh/mykey.pub
+ ```
+ :::
+
+6. Connect to the server. The private key loaded in _Pageant_ is used to authenticate.
+
+## References
+
+* [PuTTY](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html)
+* [How To Use Pageant to Streamline SSH Key Authentication with PuTTY](https://www.digitalocean.com/community/tutorials/how-to-use-pageant-to-streamline-ssh-key-authentication-with-putty)
diff --git a/tutorials/sftp_publickeyauth_pkcs11.md b/tutorials/sftp_publickeyauth_pkcs11.md
new file mode 100644
index 00000000..c64b8472
--- /dev/null
+++ b/tutorials/sftp_publickeyauth_pkcs11.md
@@ -0,0 +1,139 @@
+Configure Public Key Authentication for SFTP using a PKCS#11 Smartcard
+====
+
+> Public-key authentication with a smartcard allows you to connect to a remote server without a password. The private key is kept on the card and never leaves it. A _PKCS#11_ module, the native library shipped with the driver of your card, is used to read the public keys from the card and to sign the login with the corresponding private key protected by a PIN. This is the equivalent of `ssh -I /path/to/module.so`.
+
+:::{important}
+* Cyberduck [9.7.0](https://cyberduck.io/changelog/) or later required
+* Mountain Duck [6.0.0](https://mountainduck.io/changelog/) or later required
+:::
+
+:::{note}
+Only keys with a matching certificate on the card are found. Cards holding a key without a certificate, such as a key generated with `pkcs11-tool --keypairgen` only, cannot be used.
+:::
+
+## Setup
+
+:::::{tabs}
+::::{group-tab} macOS
+
+1. Install the _PKCS#11_ module for your card. [OpenSC](https://github.com/OpenSC/OpenSC) supports many cards including _PIV_, _CAC_ and _OpenPGP_ cards and hardware tokens such as a _YubiKey_ with the _PIV_ application.
+ ```
+ brew install opensc
+ ```
+
+ :::{tip}
+ Cyberduck already bundles _OpenSC_ and uses it by default. The installation is only required for the command line tools used in the following steps to read the public key from the card and to verify the setup with OpenSSH.
+ :::
+
+ :::{warning}
+ The module `/usr/lib/ssh-keychain.dylib` included with macOS for a smartcard paired with `sc_auth pair` can only be loaded by `ssh` and is not supported in Cyberduck and Mountain Duck.
+ :::
+
+2. Verify the module can read the certificates from the card. Insert the card first.
+ ```
+ pkcs11-tool --module /opt/homebrew/lib/opensc-pkcs11.so --list-objects --type cert
+ ```
+
+3. Print the public keys on the card and save them to a file.
+ ```
+ ssh-keygen -D /opt/homebrew/lib/opensc-pkcs11.so > ~/.ssh/smartcard.pub
+ ```
+
+ The command prints a line for every key on the card. Edit the file to only keep the line with the key to authenticate with.
+
+4. Add the public key to the `authorized_keys` in your `~/.ssh` directory on the server running OpenSSH.
+ ```
+ ssh-copy-id -fi ~/.ssh/smartcard.pub user@remotehost
+ ```
+
+5. Verify the setup with OpenSSH before connecting with Cyberduck. You are prompted for the PIN of the card.
+ ```
+ ssh -I /opt/homebrew/lib/opensc-pkcs11.so user@remotehost
+ ```
+
+6. Add a new [Bookmark](../cyberduck/bookmarks.md) in Cyberduck or Mountain Duck. Enter the alias from your OpenSSH configuration or the hostname in _Server_. You do **not** need to set a value for _Password_ because the keys are read from the card.
+
+7. In _SSH Private Key_ select the public key `smartcard.pub` saved in step 3 to only offer the matching key on the card to the server.
+
+ :::{tip}
+ With no key selected, every key on the card is offered to the server in turn. The server may respond with _[Too many authentication failures](../protocols/sftp/index.md#too-many-authentication-failures)_ when the card holds several keys.
+ :::
+
+8. Connect to the server and enter the PIN of the card when prompted. The PIN is requested once and the card remains unlocked until you quit the application.
+
+::::
+::::{group-tab} Windows
+
+1. Install the _PKCS#11_ module for your card. No module is bundled with Cyberduck on Windows. [OpenSC](https://github.com/OpenSC/OpenSC/releases) supports many cards including _PIV_, _CAC_ and _OpenPGP_ cards and hardware tokens such as a _YubiKey_ with the _PIV_ application. Choose the 64-bit installer.
+
+2. Set the [hidden configuration option](hidden_properties.md) `connection.keystore.pkcs11.library` to the path of the module and restart Cyberduck. Write the path with forward slashes.
+ ```
+ connection.keystore.pkcs11.library=C:/Program Files/OpenSC Project/OpenSC/pkcs11/opensc-pkcs11.dll
+ ```
+
+3. Add the public key of the key on the card to the `authorized_keys` in your `~/.ssh` directory on the server running OpenSSH. The public key is usually provided by the issuer of the card or can be read from the card with `ssh-keygen -D` and the path of the module.
+
+4. Add a new [Bookmark](../cyberduck/bookmarks.md). Enter the hostname in _Server_. You do **not** need to set a value for _Password_ because the keys are read from the card.
+
+5. In _SSH Private Key_ select the file with the public key to only offer the matching key on the card to the server.
+
+ :::{tip}
+ With no key selected, every key on the card is offered to the server in turn. The server may respond with _[Too many authentication failures](../protocols/sftp/index.md#too-many-authentication-failures)_ when the card holds several keys.
+ :::
+
+6. Connect to the server and enter the PIN of the card when prompted. The PIN is requested once and the card remains unlocked until you quit the application.
+
+ :::{note}
+ A card connected to the Windows computer is not available in a _Remote Desktop_ session. Connect the card to the computer running the Remote Desktop client instead and enable the redirection of smart cards.
+ :::
+
+::::
+:::::
+
+## Use a Different Module
+
+The bundled _OpenSC_ module is used by default on macOS. To use the module from the vendor of your card instead, refer to it in your OpenSSH configuration file `~/.ssh/config`. On Windows, set the path of the module with the hidden configuration option as described above.
+
+```
+Host *
+ PKCS11Provider /path/to/module.so
+```
+
+This [configuration](https://docs.cyberduck.io/protocols/sftp/#openssh-configuration-interoperability) directive is supported by Cyberduck and Mountain Duck. You can restrict the setting to a single alias in the configuration file instead of matching it for all connections with `*`. Alternatively set the [hidden configuration option](hidden_properties.md) `connection.keystore.pkcs11.library` to the absolute path of the module.
+
+## Limit Connections Using the Card
+
+With a card inserted, the keys on the card are attempted for every connection before a private key file or the prompt for a password. You are prompted for the PIN of the card including for servers you do not log in to with a key on the card, unless a password is saved for the bookmark or the login succeeds with an identity from the SSH agent.
+
+- Cancel the prompt for the PIN to skip the card. The login continues with the private key file selected in the bookmark or the prompt for a password.
+- Select a private key file for _SSH Private Key_ in the [Bookmark](../cyberduck/bookmarks.md). The card is not used and there is no prompt for the PIN.
+- Set `PKCS11Provider none` for the host in `~/.ssh/config` to not use the card.
+- Set `IdentitiesOnly yes` for the host in `~/.ssh/config`. Only the key on the card matching the public key file set with `IdentityFile` is offered and the card is not used when `IdentityFile` is missing or set to a private key file.
+ ```
+ Host remotehost
+ IdentityFile ~/.ssh/smartcard.pub
+ IdentitiesOnly yes
+ ```
+- Set the [hidden configuration option](hidden_properties.md) `ssh.authentication.pkcs11.enable` to `false` to disable authentication with a smartcard for all connections.
+
+## Troubleshooting
+
+:::{warning}
+When no key from the card is offered, verify the card holds a certificate for the key with `pkcs11-tool --module --list-objects --type cert`. A key without a certificate on the card is not found. When a public key file is selected in the bookmark, verify it matches a key on the card.
+:::
+
+:::{warning}
+When the connection continues with a prompt for a password with no prompt for the PIN before, no card was found or the module could not be loaded. Verify the card is inserted and that a path set with `PKCS11Provider` works with `ssh -I`. On Windows, verify the path set with `connection.keystore.pkcs11.library`.
+:::
+
+:::{note}
+Removing the card while connected fails the session. Reconnect with the card inserted.
+:::
+
+## References
+
+- [OpenSC supported hardware](https://github.com/OpenSC/OpenSC/wiki/Supported-hardware-%28smart-cards-and-USB-tokens%29)
+- [`PKCS11Provider` in ssh_config](https://man.openbsd.org/ssh_config#PKCS11Provider)
+- [Client certificate on a smartcard](../protocols/webdav/index.md#client-certificate-on-smartcard) for mutual TLS with WebDAV.
+- [Use a FIDO2 Security Key](sftp_publickeyauth_securitykey.md) for authentication with a key in the Secure Enclave or on a hardware token such as a YubiKey.
diff --git a/tutorials/sftp_publickeyauth_securitykey.md b/tutorials/sftp_publickeyauth_securitykey.md
new file mode 100644
index 00000000..b30c2384
--- /dev/null
+++ b/tutorials/sftp_publickeyauth_securitykey.md
@@ -0,0 +1,167 @@
+Configure Public Key Authentication for SFTP using a FIDO2 Security Key
+====
+
+> Public-key authentication with a _FIDO2_ security key allows you to connect to a remote server without a password. The private key never leaves the authenticator, which is either the Secure Enclave of your Mac unlocked with _Touch ID_ or a hardware token such as a _YubiKey_ you touch to confirm. OpenSSH calls these keys `sk-ecdsa-sha2-nistp256@openssh.com` and `sk-ssh-ed25519@openssh.com`.
+
+:::{important}
+* Cyberduck [9.7.0](https://cyberduck.io/changelog/) or later required
+* Mountain Duck [6.0.0](https://mountainduck.io/changelog/) or later required
+:::
+
+The key file in `~/.ssh` holds a reference to the credential on the authenticator but no private key. Signing a login is therefore delegated either to a _security key provider_ library talking to the authenticator or to an [SSH agent](#let-an-ssh-agent-handle-the-security-key) holding the key.
+
+:::{note}
+A security key provider library is configured by default on macOS only, serving keys in the Secure Enclave. On Windows and Linux OpenSSH talks to a token with built-in USB HID support instead of a library, which Cyberduck cannot load. Leave the key to an [SSH agent](#let-an-ssh-agent-handle-the-security-key) there, or set `SecurityKeyProvider` to a middleware library for your token on Linux. Loading a middleware library is not supported on Windows.
+:::
+
+:::{important}
+The server must run _OpenSSH 8.2_ or later. Earlier versions do not know the `sk-*` key types and ignore the entry in `authorized_keys`. Verify the version of the server with `ssh -v user@remotehost` and look for the line `remote software version`.
+:::
+
+## Create a Key in the Secure Enclave unlocked with Touch ID
+
+:::::{tabs}
+::::{group-tab} macOS
+
+1. Create an identity in the Secure Enclave protected with _Touch ID_. The private key is generated on the device and cannot be extracted.
+ ```
+ sc_auth create-ctk-identity -l "MacBook Touch ID SSH" -k p-256-ne -t bio
+ ```
+
+ :::{tip}
+ `-k p-256-ne` creates a non-extractable key on the NIST P-256 curve, the only curve supported by the Secure Enclave. `-t bio` requires _Touch ID_ to use the key.
+ :::
+
+2. Write the key file for the credential. Run the command in `~/.ssh` as the files are written to the current working directory.
+ ```
+ cd ~/.ssh && ssh-keygen -w /usr/lib/ssh-keychain.dylib -K
+ ```
+
+ :::{note}
+ When prompted with `Enter PIN for authenticator:`, press _Enter_ to leave the PIN empty. A key in the Secure Enclave has no PIN and is protected by _Touch ID_ instead. The prompt is shown by OpenSSH for any authenticator.
+ :::
+
+ This writes `id_ecdsa_sk_rk` and `id_ecdsa_sk_rk.pub`. Repeat the command with `-K` whenever you need the files again on another Mac with access to the same identity.
+
+3. Add the public key to the `authorized_keys` in your `~/.ssh` directory on the server running OpenSSH.
+ ```
+ ssh-copy-id -fi ~/.ssh/id_ecdsa_sk_rk.pub user@remotehost
+ ```
+
+4. Verify the setup with OpenSSH before connecting with Cyberduck. Confirm the prompt with _Touch ID_.
+ ```
+ ssh -o SecurityKeyProvider=/usr/lib/ssh-keychain.dylib -i ~/.ssh/id_ecdsa_sk_rk user@remotehost
+ ```
+
+ :::{tip}
+ Set the provider in `~/.ssh/config` to omit the `-o` option and the `-i` option.
+ ```
+ Host remotehost
+ User user
+ IdentityFile ~/.ssh/id_ecdsa_sk_rk
+ SecurityKeyProvider /usr/lib/ssh-keychain.dylib
+ ```
+ Cyberduck and Mountain Duck use `/usr/lib/ssh-keychain.dylib` by default on macOS and do not require this directive.
+ :::
+
+5. In the [Bookmark](../cyberduck/bookmarks.md) or [Connection](../cyberduck/connection.md) window, in _SSH Private Key_ select `id_ecdsa_sk_rk` in your `~/.ssh` directory. You do **not** need to set a value for _Password_.
+
+6. Connect to the server and confirm the prompt with _Touch ID_ to allow the Secure Enclave to sign the login.
+
+::::
+:::::
+
+## Create a Key on a Hardware Token such as YubiKey
+
+:::::{tabs}
+::::{group-tab} macOS
+
+1. Insert the security key and create a credential on the token. Touch the token when it blinks.
+ ```
+ cd ~/.ssh && ssh-keygen -t ed25519-sk -O resident
+ ```
+
+ :::{tip}
+ Use `-t ecdsa-sk` instead for tokens without support for Ed25519 credentials, such as a _YubiKey_ with a firmware version earlier than 5.2.3. Add `-O verify-required` to require the PIN of the token in addition to touching it. The option `-O resident` stores the credential on the token allowing to write the key files again on another machine with `ssh-keygen -K`.
+ :::
+
+ :::{note}
+ `ssh-keygen` talks to the token with the USB HID support built into OpenSSH. No middleware library is required to create the key. Pass `-w ` only to use a middleware library of your own instead.
+ :::
+
+2. Add the public key to the `authorized_keys` in your `~/.ssh` directory on the server running OpenSSH.
+ ```
+ ssh-copy-id -fi ~/.ssh/id_ed25519_sk.pub user@remotehost
+ ```
+
+3. Refer to the middleware library for the token in your OpenSSH configuration file `~/.ssh/config`. The default `/usr/lib/ssh-keychain.dylib` set on macOS serves keys in the Secure Enclave only.
+ ```
+ Host *
+ SecurityKeyProvider /path/to/middleware.so
+ ```
+
+ This [configuration](https://docs.cyberduck.io/protocols/sftp/#openssh-configuration-interoperability) directive is supported by Cyberduck and Mountain Duck. A value beginning with `$` is read from the environment variable of that name. Alternatively set the [hidden configuration option](hidden_properties.md) `ssh.authentication.securitykey.provider` to the path of the library.
+
+ :::{important}
+ The USB HID support built into OpenSSH is not a library and cannot be loaded. Unless the token comes with a middleware library implementing the OpenSSH security key API, leave the security key to an [SSH agent](#let-an-ssh-agent-handle-the-security-key) instead, which works with any token supported by OpenSSH.
+ :::
+
+4. In the [Bookmark](../cyberduck/bookmarks.md) or [Connection](../cyberduck/connection.md) window, in _SSH Private Key_ select `id_ed25519_sk` in your `~/.ssh` directory.
+
+5. Connect to the server and touch the security key when it blinks. Enter the PIN of the token when prompted for a key created with `-O verify-required`.
+
+::::
+:::::
+
+## Let an SSH Agent handle the Security Key
+
+Instead of talking to the authenticator, Cyberduck and Mountain Duck can leave the security key to an SSH agent. The agent prompts for the touch or the PIN and returns the signature.
+
+:::::{tabs}
+::::{group-tab} macOS
+
+1. Add the security key to the SSH agent of OpenSSH. You are asked to confirm with _Touch ID_ or to touch the token.
+ ```
+ ssh-add ~/.ssh/id_ecdsa_sk_rk
+ ```
+
+2. Verify the agent holds the key. The key type is printed as `ECDSA-SK` or `ED25519-SK`.
+ ```
+ ssh-add -l
+ ```
+
+3. Add a new [Bookmark](../cyberduck/bookmarks.md). No _SSH Private Key_ needs to be selected because the key is offered by the agent.
+
+ :::{tip}
+ The server may respond with _[Too many authentication failures](../protocols/sftp/index.md#too-many-authentication-failures)_ when the agent holds many keys. Select the public key `id_ecdsa_sk_rk.pub` for _SSH Private Key_ to only offer the matching identity from the agent.
+ :::
+
+::::
+:::::
+
+Other SSH agents manage keys of their own instead of a credential on a security key, with the approval prompt of the application taking the place of the touch. Refer to the tutorials for the [1Password SSH Agent](sftp_publickeyauth_1password.md), the [Bitwarden SSH Agent](sftp_publickeyauth_bitwarden.md) and [yubikey-agent](sftp_publickeyauth_yubikey.md) for the setup of the agent socket with `IdentityAgent` in `~/.ssh/config`.
+
+## Troubleshooting
+
+:::{warning}
+When the connection fails with the message _No security key provider configured_, no middleware library is set for your platform. A library is configured by default on macOS only. Set `SecurityKeyProvider` in `~/.ssh/config` or add the key to an SSH agent instead. A failure naming the library instead means it could not be loaded, in which case verify the path.
+:::
+
+:::{warning}
+When the connection fails with the message _Security key authentication is not supported on Windows_, the security key selected in the bookmark is not held by an SSH agent. Loading a middleware library is not supported on Windows. Add the key to an [SSH agent](#let-an-ssh-agent-handle-the-security-key) instead.
+:::
+
+:::{warning}
+When the connection fails with the message _No security key found_, the hardware token holding the key is not connected. Insert the token and connect again.
+:::
+
+:::{warning}
+When the server refuses the key without prompting for a touch, the public key is not accepted. Verify the entry in `authorized_keys` and that the server runs _OpenSSH 8.2_ or later.
+:::
+
+## References
+
+- [Cyberduck 9.7.0](https://cyberduck.io/changelog/) or later is required for authentication with a security key without an SSH agent.
+- [OpenSSH 8.2 release notes announcing FIDO/U2F support](https://www.openssh.com/txt/release-8.2)
+- [PROTOCOL.u2f describing the `sk-*` key types](https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.u2f)
+- [Yubico Developers: Securing SSH with FIDO2](https://developers.yubico.com/SSH/Securing_SSH_with_FIDO2.html)