add some examples hooks for one time password logins

The examples use Twillo Authy since I use it for my GitHub account.

You can easily use other multi factor authentication software in a
similar way.
This commit is contained in:
Nicola Murino
2020-08-18 21:21:01 +02:00
parent bbc8c091e6
commit 04c9a5c008
10 changed files with 322 additions and 5 deletions

View File

@@ -35,8 +35,8 @@ func exitError() {
u := minimalSFTPGoUser{
Username: "",
}
json, _ := json.Marshal(u)
fmt.Printf("%v\n", string(json))
resp, _ := json.Marshal(u)
fmt.Printf("%v\n", string(resp))
os.Exit(1)
}
@@ -52,8 +52,8 @@ func printSuccessResponse(username, homeDir string, uid, gid int) {
u.Permissions["/"] = []string{"*"}
// uncomment the next line to require publickey+password authentication
//u.Filters.DeniedLoginMethods = []string{"publickey", "password", "keyboard-interactive", "publickey+keyboard-interactive"}
json, _ := json.Marshal(u)
fmt.Printf("%v\n", string(json))
resp, _ := json.Marshal(u)
fmt.Printf("%v\n", string(resp))
os.Exit(0)
}