Documentation ¶
Overview ¶
Package xs - a secure terminal client/server written from scratch in Go
Copyright (c) 2017-2020 Russell Magee Licensed under the terms of the MIT license (see LICENSE.mit in this distribution)
golang implementation by Russ Magee (rmagee_at_gmail.com)
Index ¶
- func AuthUserByPasswd(ctx *AuthCtx, username string, auth string, fname string) (valid bool, allowedCmds string)
- func AuthUserByToken(ctx *AuthCtx, username string, connhostname string, auth string) (valid bool)
- func GetTool(tool string) (ret string)
- func ReadPassword(fd uintptr) ([]byte, error)
- func Restore(fd uintptr, state *State) error
- func VerifyPass(ctx *AuthCtx, user, password string) (bool, error)
- type AuthCtx
- type Session
- func (h Session) AuthCookie(reallyShow bool) []byte
- func (h *Session) ClearAuthCookie()
- func (h Session) Cmd() []byte
- func (h Session) ConnHost() []byte
- func (h Session) Op() []byte
- func (h *Session) SetAuthCookie(a []byte)
- func (h *Session) SetCmd(c []byte)
- func (h *Session) SetConnHost(n []byte)
- func (h *Session) SetOp(o []byte)
- func (h *Session) SetStatus(s uint32)
- func (h *Session) SetTermType(t []byte)
- func (h *Session) SetWho(w []byte)
- func (h Session) Status() uint32
- func (h *Session) String() string
- func (h Session) TermType() []byte
- func (h Session) Who() []byte
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthUserByPasswd ¶
func AuthUserByPasswd(ctx *AuthCtx, username string, auth string, fname string) (valid bool, allowedCmds string)
AuthUserByPasswd checks user login information using a password. This checks /etc/xs.passwd for auth info, and system /etc/passwd to cross-check the user actually exists. nolint: gocyclo
func AuthUserByToken ¶
AuthUserByToken checks user login information against an auth token. Auth tokens are stored in each user's $HOME/.xs_id and are requested via the -g option. The function also check system /etc/passwd to cross-check the user actually exists.
func ReadPassword ¶
ReadPassword reads a line of input from a terminal without local echo. This is commonly used for inputting passwords and other sensitive data. The slice returned does not include the \n.
func Restore ¶
Restore restores the terminal connected to the given file descriptor to a previous state.
Types ¶
type AuthCtx ¶
type AuthCtx struct {
// contains filtered or unexported fields
}
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session holds essential bookkeeping info about an active session.
func NewSession ¶
NewSession returns a new Session record.
func (Session) AuthCookie ¶
AuthCookie returns the authcookie (essentially the password) used for authorization of the Session. This return value is censored unless reallyShow is true (so dumps of Session Info do not accidentally leak it).
func (*Session) ClearAuthCookie ¶
func (h *Session) ClearAuthCookie()
ClearAuthCookie attempts to scrub the Session's stored authcookie.
This should of course be called as soon as possible after authentication and it is no longer required.
func (Session) Cmd ¶
Cmd returns the command requested for execution by a client initiating the Session.
func (Session) ConnHost ¶
ConnHost returns the connecting hostname/IP string for a Session.
func (Session) Op ¶
Op returns the op code of the Session (interactive shell, cmd, ...)
func (*Session) SetAuthCookie ¶
SetAuthCookie stores the authcookie (essentially the password) used to authenticate the Session.
func (*Session) SetCmd ¶
SetCmd stores the command request by the client for execution when initiating the Session.
func (*Session) SetConnHost ¶
SetConnHost stores the connecting hostname/IP string for a Session.
func (*Session) SetOp ¶
SetOp stores the op code desired for a Session.
func (*Session) SetStatus ¶
SetStatus stores the current Session status code.
func (*Session) SetTermType ¶
SetTermType stores the TERM env variable supplied by the client initiating a Session.
func (*Session) SetWho ¶
SetWho sets the username associated with a Session.
func (Session) Status ¶
Status returns the (current) Session status code.
This usually corresponds to a UNIX shell exit code, but extended codes are returns at times to indicate internal errors.
func (*Session) String ¶
Output Session record as a string. Implements Stringer interface.
func (Session) TermType ¶
TermType returns the TERM env variable reported by the client initiating a Session.
Directories ¶
Path | Synopsis |
---|---|
Package logger is a wrapper around UNIX syslog, so that it also may be wrapped with something else for Windows (Sadly, the stdlib log/syslog is frozen, and there is no Windows implementation.)
|
Package logger is a wrapper around UNIX syslog, so that it also may be wrapped with something else for Windows (Sadly, the stdlib log/syslog is frozen, and there is no Windows implementation.) |
A golang translation of a 'Shakespeare insult generator' Originally from http://www.mainstrike.com/mstservices/handy/insult.html
|
A golang translation of a 'Shakespeare insult generator' Originally from http://www.mainstrike.com/mstservices/handy/insult.html |
xsd server Copyright (c) 2017-2020 Russell Magee Licensed under the terms of the MIT license (see LICENSE.mit in this distribution) golang implementation by Russ Magee (rmagee_at_gmail.com)
|
xsd server Copyright (c) 2017-2020 Russell Magee Licensed under the terms of the MIT license (see LICENSE.mit in this distribution) golang implementation by Russ Magee (rmagee_at_gmail.com) |
Util to generate/store passwords for users in a file akin to /etc/passwd suitable for the demo hkexsh server, using bcrypt.
|
Util to generate/store passwords for users in a file akin to /etc/passwd suitable for the demo hkexsh server, using bcrypt. |