bolkedebruin / rdpgw

Remote Desktop Gateway in Go for deploying on Linux/BSD/Kubernetes
Apache License 2.0
693 stars 117 forks source link

How to us it?Enable rdpgw locally #110

Closed xiaonaiquan closed 2 months ago

xiaonaiquan commented 2 months ago

image

image

rdpgw.yml: ” Server: Authentication:

This is my code to verify the pam program: “ package main

import ( "errors" "log" "os"

"github.com/msteinert/pam"

)

func AuthPAM(username, password string) (bool, error) { handler := func(s pam.Style, msg string) (string, error) { switch s { case pam.PromptEchoOff: return password, nil case pam.PromptEchoOn, pam.ErrorMsg, pam.TextInfo: return "", nil } return "", errors.New("Unrecognized message style") }

t, err := pam.StartFunc("rdpgw", username, handler)
if err != nil {
    log.Println("init pam error: ", err)
    return false, err
}

err = t.Authenticate(0)
if err != nil {
    log.Println("pam authenticate error: ", err)
    return false, err
}
return true, nil

}

func main() { if len(os.Args) != 3 { log.Println(os.Args[0], "username", "password") return }

res, err := AuthPAM(os.Args[1], os.Args[2])
if err != nil {
    log.Println("AuthPAM error: ", err)
    return
}

log.Println("Auth ", res)

} ”

How do I connect to the remote machine through it?like freerdp. My rdpgw-auth program is working correctly. The pam program is also working correctly.

bolkedebruin commented 2 months ago

For PAM authentication there is a working docker-compose. Have a look at: https://github.com/bolkedebruin/rdpgw/blob/master/dev/docker/docker-compose-local.yml

xiaonaiquan commented 2 months ago

For PAM authentication there is a working docker-compose. Have a look at: https://github.com/bolkedebruin/rdpgw/blob/master/dev/docker/docker-compose-local.yml

It's the same. No output.I don't know how to use freerdp to link. "wfreerdp.exe /gateway:g:192.168.61.131:9443,u:xxx,p:xxxx /v:192.168.61.129:3389 /log-level:TRACE > stdout.log" It doesn't work

xiaonaiquan commented 2 months ago

@bolkedebruin Can you take a look?

bolkedebruin commented 2 months ago

@xiaonaiquan there is little to go on ("it doesn't work", doesn't help anyone to find your issue) and the docker-compose works with the standard Mac client. Your issue seems to be client side which is out of scope of this project.

So unless you provide elaborate logs that indicate an issue with rdpgw and you tried this with other clients than freerdp, I will need to close this issue unfortunately.

xiaonaiquan commented 2 months ago

@xiaonaiquan there is little to go on ("it doesn't work", doesn't help anyone to find your issue) and the docker-compose works with the standard Mac client. Your issue seems to be client side which is out of scope of this project.

So unless you provide elaborate logs that indicate an issue with rdpgw and you tried this with other clients than freerdp, I will need to close this issue unfortunately.

first , "docker-ubuntu-xrdp-mate-rdpgw" ,It doesn't work

image

second,With the client test, there is no response and no output, so I can't provide detailed logs

bolkedebruin commented 2 months ago

What is

"docker-ubuntu-xrdp-mate-rdpgw"

? An image? Where did you get this from?

xiaonaiquan commented 2 months ago

What is

"docker-ubuntu-xrdp-mate-rdpgw"

? An image? Where did you get this from?

image

It's a mirror image of you.

bolkedebruin commented 2 months ago

You are using the openid version of the docker compose.

Use https://github.com/bolkedebruin/rdpgw/blob/master/dev/docker/docker-compose-local.yml

xiaonaiquan commented 2 months ago

You are using the openid version of the docker compose.

Use https://github.com/bolkedebruin/rdpgw/blob/master/dev/docker/docker-compose-local.yml

I'm just telling you what it is, I'm sure it's using local. Can you try and see if this image works properly?

bolkedebruin commented 2 months ago

Screenshot 2024-04-16 at 17 03 24

It works.