# Every way to sign in

A user of CrushMFT is one account. How that account proves who it is depends on the protocol it comes in by, and on what you demand. This page lists all the ways side by side.

## By protocol

| Protocol | Ways to sign in | A second factor |
|---|---|---|
| the web interface (HTTPS) | user name and password; a client certificate; a single sign-on (SAML, OpenID Connect, OAuth) through a plugin; a link of a share | an authenticator app, a code by mail or SMS, a passkey |
| SFTP | password; SSH key; key **and** password; key or password **and** a typed code | a code typed at a prompt ("keyboard interactive") |
| FTP, FTPES, FTPS | user name and password; a client certificate on a TLS port | a code added to the password |
| WebDAV | user name and password, sent with every request | none that a drive mapping can ask for |
| the API | an access token; a user name and password; the browser's session | the token stands for one |
| S3 | an access key that holds user name and password | none |
| SMB | user name and password (NTLM); a Kerberos ticket | none |
| NFS | a Kerberos ticket only | none |

Which protocols an account may use at all is set per user: [Protocols a user may use](Users-Restrictions-Protocols.md).

## Where the account comes from

The name that signs in is looked up in this order:

1. the users of the listener's [connection group](Ports-Connection-Groups.md), as made in the [User Manager](Users.md);
2. the plugins that find users elsewhere: a directory (LDAP, Active Directory), a database, RADIUS, an identity provider. See the [Plugins overview](Plugins.md).
3. the user named `template`, when there is one: a stand-in for any name, used to pass a login on to another system. See [The FTP proxy](Ports-FTP-Proxy.md).

A user found by a plugin is given the settings of a template user of CrushMFT and then behaves like any other.

## Passwords on the way

- Over HTTPS, FTPS, SFTP and SMB 3, the connection is encrypted.
- On top of that, the web interface seals the password in the browser before it sends it: with a key it fetches from the server just before, good for that one field and for a short time. A password so is not readable in a proxy that opens HTTPS on the way, and not in a request log.
- Plain FTP and plain HTTP send it in the clear. Do not offer them.

## Demanding more

| You want | Set |
|---|---|
| a second factor for a user | **Two factor OTP/SMS** in [Setup](Users-Setup.md#a-second-factor): see [Two-factor sign-in](Security-Two-Factor.md) |
| keys only on an SFTP port | **Require Public Key Authentication** on the listener: [SFTP and SCP ports](Ports-SFTP.md) |
| key and password for one user | [SSH public keys of a user](Users-Restrictions-SSH-Keys.md) |
| certificates on a port | **Require valid client certificate**: [SSL on a port, SNI](Ports-SSL.md) |
| logins only from known addresses | [IP restrictions: server, port and user](Security-IP-Restrictions.md) |
| logins only at certain hours | [Days and hours](Users-Restrictions-Days.md) |
| a check that it is a person | reCAPTCHA on the login page: [IP / Servers](Ports.md#re-captcha) |
| administrators only from the office | the server's list of addresses for administration, in [Banning](Prefs-Banning.md) |

## Programs without a person

A script cannot answer a second factor and should not hold a person's password.

| For | Use |
|---|---|
| file transfer by SFTP | an SSH key, on an account made for the script, with an IP restriction |
| calls to the server | an [access token](Security-Roles-Tokens.md) that carries only what the script needs |
| S3 tools | an account made for the tool, with rights on just its folders |

## What happens at a failed login

It is logged with the name that was tried and the address it came from, counted against that address, and after too many it bans the address for a time: see [Bans and hammering](Security-Bans.md). The answer to the client does not say whether the name exists.
