User
#struct UserA user who may log in to the server.
| Name | Type | Description |
|---|---|---|
name | str = "" | The login name. |
password | str = "" | The password for a password login. |
home | str = "/" | The directory below the root where the user starts; / by default. |
import sshd
func main:
mut cfg := sshd.NewConfig()
println cfg.host, cfg.port, cfg.server_version == sshd.DefaultVersion
println cfg.allow_password, cfg.allow_publickey
println cfg.allow_exec, cfg.allow_shell, cfg.allow_sftp
println cfg.root, cfg.banner == "", cfg.users.Len()
sshd.AddUser(cfg, "alice", "s3cret", "/home/alice")
sshd.AddUser(cfg, "bob", "hunter2")
each u in cfg.users:
println u.name, u.password.len(), u.home
end
end0.0.0.0 22 true true true true true true . true 0 alice 6 /home/alice bob 7 /