mirror of
https://github.com/nwtgck/handy-sshd.git
synced 2025-06-14 12:04:50 +00:00
require one user at least
This commit is contained in:
parent
0b3b8d0f96
commit
54b502d3ae
2 changed files with 5 additions and 3 deletions
|
@ -101,7 +101,11 @@ var RootCmd = &cobra.Command{
|
|||
}
|
||||
sshUsers = append(sshUsers, sshUser{name: splits[0], password: splits[1]})
|
||||
}
|
||||
|
||||
if len(sshUsers) == 0 {
|
||||
return fmt.Errorf(`No user specified
|
||||
e.g. --user "john:mypassword"
|
||||
e.g. --user "john:"`)
|
||||
}
|
||||
// (base: https://gist.github.com/jpillora/b480fde82bff51a06238)
|
||||
sshConfig := &ssh.ServerConfig{
|
||||
//Define a function to run when a client attempts a password login
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/nwtgck/handy-sshd/cmd"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
if err := cmd.RootCmd.Execute(); err != nil {
|
||||
_, _ = fmt.Fprintf(os.Stderr, err.Error())
|
||||
os.Exit(-1)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue