diff --git a/.gitignore b/.gitignore index 1bec925..6207059 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ host_key host_key.pub ssh-chat +*.log diff --git a/client.go b/client.go index b780aa9..e68d7f5 100644 --- a/client.go +++ b/client.go @@ -95,7 +95,7 @@ func (c *Client) ColoredName() string { // SysMsg sends a message in continuous format over the message channel func (c *Client) SysMsg(msg string, args ...interface{}) { - c.Msg <- ContinuousFormat(systemMessageFormat, "-> "+fmt.Sprintf(msg, args...)) + c.Send(ContinuousFormat(systemMessageFormat, "-> "+fmt.Sprintf(msg, args...))) } // Write writes the given message @@ -256,7 +256,7 @@ func (c *Client) handleShell(channel ssh.Channel) { c.SysMsg("Missing $NAME from: /nick $NAME") } case "/whois": - if len(parts) == 2 { + if len(parts) >= 2 { client := c.Server.Who(parts[1]) if client != nil { version := reStripText.ReplaceAllString(string(client.Conn.ClientVersion()), "") diff --git a/server.go b/server.go index d22db99..c425b80 100644 --- a/server.go +++ b/server.go @@ -80,6 +80,9 @@ func NewServer(privateKey []byte) (*Server, error) { perm := &ssh.Permissions{Extensions: map[string]string{"fingerprint": fingerprint}} return perm, nil }, + KeyboardInteractiveCallback: func(conn ssh.ConnMetadata, challenge ssh.KeyboardInteractiveChallenge) (*ssh.Permissions, error) { + return nil, nil + }, } config.AddHostKey(signer)