func checkUsername(user string) bool {
	if config.AllowBadUsername {
		return true
	}
	return usernameRule.MatchString(user)
}
return false if username is not a valid unix user name
this is for security reason
package workingdir
import (
	"bufio"
	"bytes"
	"fmt"
	"github.com/tg123/sshpiper/sshpiperd/upstream"
	"golang.org/x/crypto/ssh/knownhosts"
	"io/ioutil"
	"net"
	"os"
	"path"
	"regexp"
	"strings"
	"golang.org/x/crypto/ssh"
)
type userFile string
var (
	userAuthorizedKeysFile userFile = "authorized_keys"
	userKeyFile            userFile = "id_rsa"
	userUpstreamFile       userFile = "sshpiper_upstream"
	userKnownHosts         userFile = "known_hosts"
	usernameRule *regexp.Regexp
)
func init() {
	usernameRule, _ = regexp.Compile("^[a-z_][-a-z0-9_]{0,31}$")
}
func userSpecFile(user, file string) string {
	return path.Join(config.WorkingDir, user, file)
}
func (file userFile) read(user string) ([]byte, error) {
	return ioutil.ReadFile(userSpecFile(user, string(file)))
}
func (file userFile) realPath(user string) string {
	return userSpecFile(user, string(file))
}
func (file userFile) checkPerm(user string) error {
	filename := userSpecFile(user, string(file))
	f, err := os.Open(filename)
	if err != nil {
		return err
	}
	defer f.Close()
	fi, err := f.Stat()
	if err != nil {
		return err
	}
	if config.NoCheckPerm {
		return nil
	}
	if fi.Mode().Perm()&0077 != 0 {
		return fmt.Errorf("%v's perm is too open", filename)
	}
	return nil
}