func (s *Server) CheckConfig(config *ClientConfig) error {
	if !config.Allowed && (s.PasswordAuthScript != "" || s.PublicKeyAuthScript != "") {
		log.Debugf("config.Allowed = false")
		return fmt.Errorf("Access not allowed")
	}
	if s.AllowedImages != nil {
		allowed := false
		for _, image := range s.AllowedImages {
			if image == config.ImageName {
				allowed = true
				break
			}
		}
		if !allowed {
			log.Warnf("Image is not allowed: %q", config.ImageName)
			return fmt.Errorf("Image not allowed")
		}
	}
	return nil
}
CheckConfig checks if the ClientConfig has access
package ssh2docker
import (
	"encoding/json"
	"fmt"
	"os"
	"os/exec"
	"strings"
	"github.com/apex/log"
	"github.com/mitchellh/go-homedir"
	"github.com/moul/ssh2docker/pkg/envhelper"
	"github.com/parnurzeal/gorequest"
	"golang.org/x/crypto/ssh"
)